基于单片机的多路温度采集系统外文文献翻译
基于单片机的多路温度采集系统设计
ANYANG INSTITUTE OF TECHNOLOGY本科毕业论文基于单片机的多路温度采集系统设计Based on Single Chip Multi-channel Temperature AcquisitionSystem Design系(院)名称:电子信息与电气工程系专业班级: 0000级自动化00班学生姓名: 123指导教师姓名: 000指导教师职称:讲师000 年00月基于单片机的多路温度采集系统设计专业班级: 000级自动化00班学生姓名: 000指导教师: 000 职称: 讲师摘要:单片机系统的开发应用给现代工业测控领域带来了一次新的技术革命,自动化、智能化均离不开单片机的应用。
单片机是一种集CPU、RAM、ROM、I/O接口和中断系统等部分于一体的器件,只需要外加电源和晶振就可实现对数字信息的处理和控制。
单片机由于其微小的体积和极低的成本,广泛的应用于家用电器、工业控制等领域中。
温度控制系统是利用下位机设置温度上下限和实时温度的采集,并将结果传输到上位机。
以达到对温度的比较、控制。
本设计用MCS-51单片机为主要硬件,设计了包括温度采集,温度显示,系统控制,串口通信等外围电路。
而且对所设计电路给出了相应的软件设计,包括定时器初始化,串行口初始化和数据传输等程序。
在温度测量部分采用具有“一线总线”接口的数字传感器DS18B20,实现单线多点数据的采集。
多点温度检测与控制系统是典型的集散式控制系统。
由下位机、上位机、和通讯网络三部分组成。
下位机是基于单片机AT89C52和DS18B20的高精度温度采集系统,功能是对温度的检测与输出控制。
上、下位机之间通过RS-232总线构成网络系统。
关键词:MCS-51;DS18B20;温度采集;RS-232Based on Single Chip Multi-channel Temperature AcquisitionSystem DesignAbstract:The development and application of MCU (Micro Control Unit) have made a great change in many fields of modern industrial detect and control. Adopt Single-ChipMicrocomputer is it control convenient, simple, flexibility advantage such as being heavy to have not merely to control to go on to temperature to come, and can raise by technical indicator not to accuse of temperature by a large margin, thus can big improvement quality and the quantity of products. Because of the small scale, low price and high efficiency of MCU, it iswidely used in home appliances and industrial control.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 uses MCS-51 The monolithic integrated circuit is the main hardware, In order to realize design goal this design including temperature gathering, the temperature demonstrated that, the systems control, strung together periphery electric circuit and so on mouth correspondence. Moreover to design the electric circuit to produce the corresponding software design, including timer initialization, serial procedure and so on mouth initialization and data transmission. The 1-Wire bus digital thermometer DS18B20 is used to measure temperature. It can realize the 1-Wire multi-point collection.Several points of temperature examination and control system is typically concentrate-dispersesystem. It consists of up a machine, bottom a machine, and communication network. Bottom a machine is a high accuracy data collection system that bases on the microcontroller AT89C52 and the DS18B20 system. Its function is to temperature and output the control. The up machine and bottom machines constitute of network system, via RS-232 bus.Key words: MCS-51;Temperature gathering;DS18B20;RS-232目录摘要 (Ⅰ)Abstract (Ⅱ)引言 (1)第一章多路温度采集显示系统的设计要求与设计方案 (2)1.1系统设计任务和要求 (2)1.2课题分析 (2)1.3方案比较与方案论证 (3)1.4方案论证和选定 (5)第二章多路温度采集系统硬件的设计 (7)2.1总体分析 (7)2.2A T89C52单片机的性能及应用 (7)2.3DS18B20芯片简介 (10)2.4DS18B20与单片机的典型接口设计 (14)2.5DS18B20使用中注意事项 (16)2.6温度检测系统设计 (16)2.7硬件电路设计 (18)第三章多路温度采集系统的软件设计 (20)3.1程序流程图设计 (20)3.2程序设计 (20)3.3单通道显示 (23)3.4串行通信 (24)第四章系统的抗干扰技术 (25)4.1硬件抗干扰技术 (25)4.2软件抗干扰技术 (25)结论 (27)致谢 (28)参考文献 (29)附录1:DS18B20温度测量程序 (30)引言近些年计算机领域的变化令人目不暇接,而单片微型计算机(简称单片机),作为微型计算机家族中的一员、发展中的一个分支,以其体积小、单一电源、功能强、价格低廉、低功耗、运算速度快、可靠性高、面向控制等独特优点,越来越深受各个应用领域的关注和重视,应用十分广泛,发展极快。
单片机-温度控制系统-外文翻译-外文文献-英文文献-中英翻译
Design of the Temperature Control System Based on AT89C51ABSTRACTThe 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; temperature1 INTRODUCTIONTemperature 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 beconvenient 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 IntroductionThe 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 features4Kbytes 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 oscil–lator disabling all other chip functions until the next hardware reset.1.3Pin DescriptionVCC 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 pullups. 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 (MOVX@DPTR). 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 programmemory. 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 ModeIn 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 AlgorithmBefore 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 more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached. Data Polling: The AT89C51 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.2.1Ready/Busy:The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done toindicate READY.Program Verify:If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.2.2 Chip Erase:The entire Flash array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.2.3 Reading the Signature Bytes:The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned areas follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programming2.4 Programming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. A microcomputer interface converts information between two forms. Outside the microcomputer the information handled by an electronic system exists as a physical signal, but within the program, it is represented numerically. The function of any interface can be broken down into a number of operations which modify the data in some way, so that the process of conversion between the external and internal forms is carried out in a number of steps. An analog-to-digital converter(ADC) is used to convert a continuously variable signal to a corresponding digital form which can take any one of a fixed number of possible binary values. If the output of thetransducer does not vary continuously, no ADC is necessary. In this case the signal conditioning section must convert the incoming signal to a form which can be connected directly to the next part of the interface, the input/output section of the microcomputer itself. Output interfaces take a similar form, the obvious difference being that here the flow of information is in the opposite direction; it is passed from the program to the outside world. In this case the program may call an output subroutine which supervises the operation of the interface and performs the scaling numbers which may be needed for digital-to-analog converter(DAC). This subroutine passes information in turn to an output device which produces a corresponding electrical signal, which could be converted into analog form using a DAC. Finally the signal is conditioned(usually amplified) to a form suitable for operating an actuator. The signals used within microcomputer circuits are almost always too small to be connected directly to the outside world” and some kind of interface must be used to translate them to a more appropriate form. The design of section of interface circuits is one of the most important tasks facing the engineer wishing to apply microcomputers. We have seen that in microcomputers information is represented as discrete patterns of bits; this digital form is most useful when the microcomputer is to be connected to equipment which can only be switched on or off, where each bit might represent the state of a switch or actuator. To solve real-world problems, a microcontroller must have more than just a CPU, a program, and a data memory. In addition, it must contain hardware allowing the CPU to access information from the outside world. Once the CPU gathers information and processes the data, it must also be able to effect change on some portion of the outside world. These hardware devices, called peripherals, are the CPU’s window to the outside.The most basic form of peripheral available on microcontrollers is the general purpose I70 port. Each of the I/O pins can be used as either an input or an output. The function of each pin is determined by setting or clearing corresponding bits in a corresponding data direction register during the initialization stage of a program. Each output pin may be driven to either a logic one or a logic zero by using CPU instructions to pinmay be viewed (or read.) by the CPU using program instructions. Some type of serial unit is included on microcontrollers to allow the CPU to communicate bit-serially with external devices. Using a bit serial format instead of bit-parallel format requires fewer I/O pins to perform the communication function, which makes it less expensive, but slower. Serial transmissions are performed either synchronously or asynchronously.3 SYSTEM GENERAL DESIGNThe hardware block diagram of the TC is shown in Fig. 1. The system hardware includes the micro controller, temperature detection circuit, keyboard control circuit, clock circuit, Display, alarm, drive circuit and external RAM. Based on the AT89C51, the DS18B20 will transfer the temperature signal detected to digital signal. And the signal is sent to the micro controller for processing. At last the temperature value is showed on the LCD 12232F. These steps are used to achieve the temperature detection. Using the keyboard interface chip HD7279 to set the temperature value, using the micro controller to keep a certain temperature, and using the LCD to show the preset value for controlling the temperature. In addition, the clock chip DS1302 is used to show time and the external RAM 6264 is used to save the monitoring data. An alarm will be given by buzzer in time if the temperature exceeds the upper and lower limit value of the temperature.3.1 HARDWARE DESIGNA. Micro controllerThe AT89C51 is a low-power, high-performance CMOS 8-bit micro controller with 4K bytes of in-system programmable Flash memory. The device is manufactured using At mel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the At mel AT89C51 is a powerful micro controller which provides a highly-flexible and cost-effective solution to many embedded control applications. Minimum system of the micro controller is shown inFig. 2. In order to save monitoring data, the 6264 is used as an external RAM. It is a static RAM chip, low-power with 8K bytes memory.B. Temperature Detection CircuitThe temperature sensor is the key part in the system. The Dallas DS18B20 is used, which supports the 1-Wire bus interface, and the ON-BOARD Patented is used internally. All the sensor parts and the converting circuit are integrated in integrated circuit like a transistor [1]. Its measure range is -55℃~125 ℃, and the precision between -10℃~85℃is ±0.5℃[2 ,3]. The temperature collected by the DS18B20 is transmitted in the 1-Wire bus way, and this highly raises the system anti-jamming and makes it fit in situ temperature measurement of the rugged environment [4]. There are two power supply ways for the DS18B20. The first is external power supply: the first pin of the DS18B20 is connected to the ground; the second pin serves as signal wire and the third is connected to the power. The second way is parasite power supply [5]. As the parasite power supply will lead to the complexity of the hardware circuit, the difficulty of the software control and the performance degradation of the chip, etc. But the DS18B20(s) can be connected to the I/O port of the micro controller in the external power supply way and it is more popular. Therefore the external power supply is used and the second pin is connected to the pin P1.3 of the AT89S51. Actually, if there are multipoint to be detected, the DS18B20(s) can be connected to the 1-Wire bus. But when the number is over 8, there is a concern to the driving and the more complex software design as well as the length of the 1-Wire bus. Normally it is no more than 50m. To achieve distant control, the system can be designed in to a wireless one to breakthe length limit of the 1-Wire bus [6].C. LCD CircuitThe LCD 12232F is used, which can be used to show characters, temperature value and time, and supply a friendly display interface. The 12232F is a LCD with 8192 128×32 pixels Chinese character database and 128 16×8 pixels ASCII character set graphics. It mainly consists of row drive/column drive and 128×32 full lattice LCD with the function of displaying graphics as well as 7.5×2 Chinese characters. It is in aparallel or serial mode to connect to external CPU [7]. In order to economize the hardware resource, the 12232F should be connected to the AT89S51 in serial mode with only 4 output ports used. The LCD grayscale can be changed by adjusting the variable resistor connected the pin Vlcd of the LCD. CLK is used to transmit serial communication clock. SID is used to transmit serial data. CS is used to enable control the LCD. L+ is used to control the LCD backlight power.D. Clock CircuitThe Dallas DS18B20 is used, which is a high performance, low-power and real-time clock chip with RAM. The DS18B20 serves in the system with calendar clock and is used to monitor the time. The time data is read and processed by the AT89C51 and then displayed by the LCD. Also the time can be adjusted by the keyboard. The DS18B20 crystal oscillator is set at 32768Hz, and the recommended compensation capacitance is 6pF. The oscillator frequency is lower, so it might be possible not to connect the capacitor, and this would not make a big difference to the time precision. The backup power supply can be connected to a 3.6V rechargeable battery.E. Keyboard Control CircuitThe keyboard interface in the system is driven by the HD7279A which has a +5V single power supply and which is connected to the keyboard and display without using any active-device. According to the basic requirements and functions of the system, only 6 buttons are needed. The system's functions are set by the AT89C51 receiving the entered data. In order to save the external resistor, the 1×6 keyboard is used, and the keyboard codes are defined as: 07H, 0FH, 17H, 1FH, 27H, 2FH. The order can be read out by reading the code instruction. HD7279A is connected to the AT89S51 in serial mode and only 4 ports are need. As shown in Fig. 6, DIG0~DIG5 and DP are respectively the column lines and row line ports of the six keys which achieve keyboard monitoring, decoding and key codes identification.F. Alarm CircuitIn order to simplify the circuit and convenient debugging, a 5V automatic buzzer is used in the alarm circuit [8]. And this make the software programming simplified. As shown in Fig. 7, it is controlled bythe PNP transistor 9012 whose base is connected to the pin P2.5 of the AT89C51. When the temperature exceeds the upper and lower limit value, the P2.5 output low level which makes the transistor be on and then an alarm is given by the buzzer.G. Drive CircuitA step motor is used as the drive device to control the temperature. The four-phase and eight-beat pulse distribution mode is used to drive motor and the simple delay program is used to handle the time interval between the pulses to obtain different rotational speed. There are two output states for the step motor. One: when the temperature is over the upper value, the motor rotates reversely (to low the temperature), while when lower than the lower limit value, the motor rotates normally (to raise the temperature); besides not equals the preset value. Two: when the temperature is at somewhere between the two ends and equals the preset value, the motor stops. These steps are used to achieve the temperature control. In addition, the motor speed can also be adjusted by relative buttons. As shown in Fig. 8, the code data is input through ports A11~A8 (be P2.3~P2.0) of the AT89C51 and inverted output by the inverter 74LS04. Finally it is amplified by the power amplifier 2803A to power the motor.3.2 SOFTWARE DESIGNAccording to the general design requirement and hardware circuit principle of the system, as well as the improvement of the program readability, transferability and the convenient debugging, the software design is modularized. The system flow mainly includes the following 8 steps: POST (Power-on self-test), system initiation, temperature detection, alarm handling, temperature control, clock chip DS18B20 operation, LCD and keyboard operation. The main program flow is shown in Fig. 9. Give a little analysis to the above 8 tasks, it is easy to find out that the last five tasks require the real time operation. But to the temperature detection it can be achieved with timer0 timing 1 second, that is to say temperature detection occurs per second. The system initiation includes global variable definition, RAM initiation, special function register initiation and peripheral equipment initiation. Global variable definition mainly finishes the interface definition of external interfacechip connected to the AT89C51, and special definition of some memory units. RAM initiation mainly refers to RAM processing. For example when the system is electrified the time code will be stored in the internal unit address or the scintillation flag will be cleared. The special function register initiation includes loading the initial value of timer and opening the interrupt. For example, when the system is electrified the timer is initialized. The peripheral equipment initiation refers to set the initial value of peripheral equipment. For example, when the system is electrified, the LCD should be initialized, the start-up display should be called, the temperature conversion command should be issued firstly and the clock chip DS18B20 should also be initialized. The alarm handling is mainly the lowering and the raising of temperature to make the temperature remain with the preset range. When the temperature is between the upper and the lower limit value, it goes to temperature control handling, that is to say the temperature need to be raised or lowered according to the preset value. By doing so make the condition temperature equal to the preset value and hence to reach the temperature target.4 CONCLUSIONThe temperature control system has the advantages of friendly human-computer interaction interface, simple hardware, low cost, high temperature control precision (error in the range of ±1 ℃), convenience and versatility, etc. It can be widely used in the occasions with -55℃to 125℃range, and there is a certain practical value.。
基于单片机的温湿度控制系统英文文献
英文文献翻译学生姓名刘学毅专业自动化学号*******分院电子工程分院2012年 6 月1. 外文原文A: Fundamentals of Single-chip MicrocomputerTh e s i n gl e-chi p m i cr o co m p ut er i s t h e cul m i n a t i o n of bot h t h e d e v el opm e nt o f t he di gi t a l c om p ut e r a n d t h e i n t e gr a t ed ci r cu i t a rgu a b l y t h e t ow m o st si gn i fi c ant i nv en t i on s of t h e 20t h ce n t u r yT h es e t ow t yp e s o f a r chi t ec t u r e a re f ou nd i n s i n gl e-c hi p m i c r o com pu t e r.S om e e m p l o y t h e s pl i t p r o gr am/d at a m e m or y o f t h e H ar v a rd a r ch i t e c t ur e, ot h e rs fol l o w t h e ph i l os o ph y,wi d el y a d a pt ed f or ge n e r al-pu rp os e co m p ut er s an d m i c r op ro c es s o r s,o f m a ki n g no l o gi c a l d i st i n ct i o n b et w een pr o gr am an d d at a m em o r y a s i n t h e P r i n c et on a r c hi t ec t u r e, s ho w n i n Fi g.3-5A-2.In ge n e r a l t e rm s a s i n gl e-chi p m i c ro co m p ut e r i s ch a r ac t e r i z ed b y t h e i n c o rp or a t i on o f al l t h e u ni t s o f a c om p ut e r i nt o a s i n gl e d e vi c e.Read only memory (ROM)R OM i s us ua l l y f o r t h e p er m an e nt,no n-vo l at i l e s t o ra ge o f a n a p pl i c a t i o ns p r o gr am .M an y m i c ro co m p ut e rs an d m i c ro c on t rol l er s a r e i n t en de d fo r h i gh-v ol u m e a pp l i c at i on s an d he n c e t h e e c o no m i c al m a nu f ac t ur e o f t h e d evi c es r e qui r es t h at t h e c o nt e nt s o f t h e p ro gr a m m e m or y b e c o m m i t t e d p er m a n en t l y d u r i n g t he m a nu f a ct ur e o f chi p s . C l e a rl y, t hi s i m pl i e s a r i go ro us ap p ro a c h t o R OM co d e d ev el op m ent s i n c e c h ange s c a nn ot b e m a d e af t er m a nu f a ct ur e.T hi s d e v el o pm e nt p r o ce s s m a y i n v ol v e em ul at i o n u si n g a so ph i s t i ca t e d d ev el op m ent s ys t em wi t h a h a rd w a r e e m ul at i on ca p ab i l i t y a s w el l a s t h e u s e of p ow e r fu l s o ft w ar e t ool s.S om e m a nu f a ct ur er s p ro vi de ad di t i o n al R O M opt i o ns b y i n cl u di n g i n t h ei r r a n ge d evi c e s wi t h (o r i nt e nd e d fo r u s e wi t h) u s e r p r o gr am m a bl e m e m o r y.T he si m pl es t o f t h es e i s u s u al l y d e vi c e wh i ch c an op e r at e i n a m i c ro pro c e s s or m o d e b y u s i n g so m e o f t h e i np ut/o ut p ut l i n es a s an a dd r ess a nd d at a bu s f o r a c c e ss i n g ex t er n al m em o r y.T hi s t yp e o f d ev i ce c a n b e ha v e f un c t i on al l y a s t h e si n gl e chi p m i cr o c om p ut e r f r om wh i ch i t i s d er i v e d al b e i t w i t h r e st ri c t ed I/O an d a m od i f i ed ex t er n al c i r c ui t. T h e u s e o f t h es e R OM l ess d ev i c es i s c om m on e v en i n pr o du ct i o n ci r cu i t s w h e r e t h e v ol um e d o es n ot j us t i f y t h e d ev e l o pm e n t c os t s o f cu s t om on-ch i p R OM[2];t he r e c a n s t i l l be a si gni fi c an t s avi n g i n I/O an d ot h er c h i p s c om p ar e d t o a c on v en t i o n al m i c ro p ro c es so r ba s ed c i r c ui t. M o r e ex a c t r ep l ac em e nt f o r R O M de vi c es c an b e o bt ai ne d i n t h e f o rm o f v a ri a nt s wi t h 'pi gg y-b a c k' E P R OM(E ra s ab l e p ro gr a m m a bl e R OM)so ck e t s or de v i ce s wi t h EP R OM i n s t e ad of R O M。
单片机温度控制英文文献及翻译
Temperature Control Using a Microcontroller:An Interdisciplinary Undergraduate Engineering Design ProjectJames S. McDonaldDepartment of Engineering ScienceTrinity UniversitySan Antonio, TX 78212AbstractThis paper describes an interdisciplinary desig n project which was done under the author’s supervision by a group of four senior students in the Department of Engineering Science at Trinity University. The objective of the project was to develop a temperature control system for an air-filled chamber. The system was to allow entry of a desired chamber temperature in a prescribed range and to exhibit overshoot and steady-state temperature error of less than 1 degree Kelvin in the actual chamber temperature step response. The details of the design developed by this group of students, based on a Motorola MC68HC05 family microcontroller, are described. The pedagogical value of the problem is also discussed through a description of some of the key steps in the design process. It is shown that the solution requires broad knowledge drawn from several engineering disciplines including electrical, mechanical, and control systems engineering.1 IntroductionThe design project which is the subject of this paper originated from a real-world application.A prototype of a microscope slide dryer had been developed around an OmegaTM modelCN-390 temperature controller, and the objective was to develop a custom temperature control system to replace the Omega system. The motivation was that a custom controller targeted specifically for the application should be able to achieve the same functionality at a much lower cost, as the Omega system is unnecessarily versatile and equipped to handle a wide variety of applications.The mechanical layout of the slide dryer prototype is shown in Figure 1. The main element of the dryer is a large, insulated, air-filled chamber in which microscope slides, each with a tissue sample encased in paraffin, can be set on caddies. In order that the paraffin maintain the proper consistency, the temperature in the slide chamber must be maintained at a desired (constant) temperature. A second chamber (the electronics enclosure) houses a resistive heater and the temperature controller, and a fan mounted on the end of the dryer blows air across the heater, carrying heat into the slide chamber. This design project was carried out during academic year 1996–97 by four students under the author’s supervision as a Senior Design project in the Department of Engineering Science at Trinity University. The purpose of this paper isto describe the problem and the students’ solution in some detail, and to discuss some of the pedagogical opportunities offered by an interdisciplinary design project of this type. The students’ own report was presented at the 1997 Nat ional Conference on Undergraduate Research [1]. Section 2 gives a more detailed statement of the problem, including performance specifications, and Section 3 describes the students’ design. Section 4 makes up the bulk of the paper, and discusses in some detail several aspects of the design process which offer unique pedagogical opportunities. Finally, Section 5 offers some conclusions.2 Problem StatementThe basic idea of the project is to replace the relevant parts of the functionality of an Omega CN-390 temperature controller using a custom-designed system. The application dictates that temperature settings are usually kept constant for long periods of time, but it’s nonetheless important that step changes be tracked in a ―reasonable‖ manner. Thus the mai n requirements boil down to·allowing a chamber temperature set-point to be entered,·displaying both set-point and actual temperatures, and·tracking step changes in set-point temperature with acceptable rise time, steady-state error, and overshoot.Although not explicitly a part of the specifications in Table 1, it was clear that the customer desired digital displays of set-point and actual temperatures, and that set-point temperature entry should be digital as well (as opposed to, say, through a potentiometer setting).3 System DesignThe requirements for digital temperature displays and setpoint entry alone are enough to dictate that a microcontrollerbased design is likely the most appropriate. Figure 2 shows a block diagram of the students’ design.The microcontroller, a MotorolaMC68HC705B16 (6805 for short), is the heart of the system. It accepts inputs from a simple four-key keypad which allow specification of the set-point temperature, and it displays both set-point and measured chamber temperatures using two-digit seven-segment LED displays controlled by a display driver. All these inputs and outputs are accommodated by parallel ports on the 6805. Chamber temperature is sensed using apre-calibrated thermistor and input via one of the 6805’s an alog-to-digital inputs. Finally, a pulse-width modulation (PWM) output on the 6805 is used to drive a relay which switches line power to the resistive heater off and on.Figure 3 shows a more detailed schematic of the electronics and their interfacing to the 6805. The keypad, a Storm 3K041103, has four keys which are interfaced to pins PA0{ PA3 of Port A, configured as inputs. One key functions as a mode switch. Two modes are supported: set mode and run mode. In set mode two of the other keys are used to specify the set-point temperature: one increments it and one decrements. The fourth key is unused at present. The LED displays are driven by a Harris Semiconductor ICM7212 display driver interfaced to pins PB0{PB6 of Port B, configured as outputs. The temperature-sensing thermistor drives, through a voltage divider, pin AN0 (one of eight analog inputs). Finally, pin PLMA (one of two PWM outputs) drives the heater relay.Software on the 6805 implements the temperature control algorithm, maintains the temperature displays, and alters the set-point in response to keypad inputs. Because it is not complete at this writing, software will not be discussed in detail in this paper. The control algorithm in particular has not been determined, but it is likely to be a simple proportional controller and certainly not more complex than a PID. Some control design issues will be discussed in Section 4, however.4 The Design ProcessAlthough essentially the project is just to build a thermostat, it presents many nice pedagogical opportunities. The knowledge and experience base of a senior engineering undergraduate are just enough to bring him or her to the brink of a solution to various aspects of the problem. Yet, in each case, realworld considerations complicate the situation significantly.Fortunately these complications are not insurmountable, and the result is a very beneficial design experience. The remainder of this section looks at a few aspects of the problem which present the type of learning opportunity just described. Section 4.1 discusses some of the featuresof a simplified mathematical model of the thermal properties of the system and how it can beeasily validated experimentally. Section 4.2 describes how realistic control algorithm designs can be arrived at using introductory concepts in control design. Section 4.3 points out some important deficiencies of such a simplified modeling/control design process and how they can be overcome through simulation. Finally, Section 4.4 gives an overview of some of the microcontroller-related design issues which arise and learning opportunities offered.4.1 MathematicalModelLumped-element thermal systems are described in almost any introductory linear control systems text, and just this sort of model is applicable to the slide dryer problem. Figure 4 shows a second-order lumped-element thermal model of the slide dryer. The state variables are the temperatures Ta of the air in the box and Tb of the box itself. The inputs to the system are the power output q(t) of the heater and the ambient temperature T¥. ma and mb are the masses of the air and the box, respectively, and Ca and Cb their specific heats. μ1 and μ2 are heat transfer coefficients from the air to the box and from the box to the external world, respectively.It’s not hard to show that the (linearized) state equationscorresponding to Figure 4 areTaking Laplace transforms of (1) and (2) and solving for Ta(s), which is the output of interest, gives the following open-loop model of the thermal system:where K is a constant and D(s) is a second-order polynomial.K, tz, and the coefficients ofD(s) are functions of the variousparameters appearing in (1) and (2).Of course the various parameters in (1) and (2) are completely unknown, but it’s not hard to show that, regardless of their values, D(s) has two real zeros. Therefore the main transfer function of interest (which isthe one from Q(s), si nce we’ll assume constant ambient temperature) can be writtenMoreover, it’s not too hard to show that 1=tp1 <1=tz <1=tp2, i.e., that the zero lies between the two poles. Both of these are excellent exercises for the student, and the result is the openloop pole-zero diagram of Figure 5.Obtaining a complete thermal model, then, is reduced to identifying the constant K and the three unknown time constants in (3). Four unknown parameters is quite a few, but simple experiments show that 1=tp1 _ 1=tz;1=tp2 so that tz;tp2 _ 0 are good approximations. Thus the open-loop system is essentially first-order and can therefore be written(where the subscript p1 has been dropped).Simple open-loop step response experiments show that,for a wide range of initial temperatures and heat inputs, K _0:14 _=W and t _ 295 s.14.2 Control System DesignUsing the first-order model of (4) for the open-loop transfer function Gaq(s) and assuming for the moment that linear control of the heater power output q(t) is possible, the block diagram of Figure 6 represents the closed-loop system. Td(s) is the desired, or set-point, temperature,C(s) is the compensator transfer function, and Q(s) is the heater output in watts.Given this simple situation, introductory linear control design tools such as the root locus method can be used to arrive at a C(s) which meets the step response requirements on rise time, steady-state error, and overshoot specified in Table 1. The upshot, of course, is that a proportional controller with sufficient gain can meet all specifications. Overshoot is impossible, and increasing gains decreases both steady-state error and rise time.Unfortunately, sufficient gain to meet the specifications may require larger heat outputs than the heater is capable of producing. This was indeed the case for this system, and the result is that the rise time specification cannot be met. It is quite revealing to the student how useful such an oversimplified model, carefully arrived at, can be in determining overall performance limitations.4.3 Simulation ModelGross performance and its limitations can be determined using the simplified model of Figure 6, but there are a number of other aspects of the closed-loop system whose effects on performance are not so simply modeled. Chief among these are·quantization error in analog-to-digital conversion of the measured temperature and· the use of PWM to control the heater.Both of these are nonlinear and time-varying effects, and the only practical way to study them is through simulation (or experiment, of course).Figure 7 shows a SimulinkTM block diagram of the closed-loop system which incorporates these effects. A/D converter quantization and saturation are modeled using standard Simulink quantizer and saturation blocks. Modeling PWM is more complicated and requires a customS-function to represent it.This simulation model has proven particularly useful in gauging the effects of varying thebasic PWM parameters and hence selecting them appropriately. (I.e., the longer the period, the larger the temperature error PWM introduces. On the other hand, a long period is desirable to avoid excessive relay ―chatter,‖ among other things.) PWM is often difficult for students to grasp, and the simulation model allows an exploration of its operation and effects which is quite revealing.4.4 The MicrocontrollerSimple closed-loop control, keypad reading, and display control are some of the classic applications of microcontrollers, and this project incorporates all three. It is therefore an excellent all-around exercise in microcontroller applications. In addition, because the project isto produce an actual packaged prototype, it won’t do to use a simple evaluation board with theI/O pins jumpered to the target system. Instead, it’s necessary to d evelop a complete embedded application. This entails the choice of an appropriate part from the broad range offered in a typical microcontroller family and learning to use a fairly sophisticated development environment. Finally, a custom printed-circuit board for the microcontroller and peripherals must be designed and fabricated.Microcontroller Selection. In view of existing local expertise, the Motorola line of microcontrollers was chosen for this project. Still, this does not narrow the choice down much. A fairly disciplined study of system requirements is necessary to specify which microcontroller, out of scores of variants, is required for the job. This is difficult for students, as they generally lack the experience and intuition needed as well as the perseverance to wade through manufacturers’ selection guides.Part of the problem is in choosing methods for interfacing the various peripherals (e.g., what kind of display driver should be used?). A study of relevant Motorola application notes [2, 3, 4] proved very helpful in understandingwhat basic approaches are available, and what microcontroller/peripheral combinations should be considered.The MC68HC705B16 was finally chosen on the basis of its availableA/D inputs and PWMoutputs as well as 24 digital I/O lines. In retrospect this is probably overkill, as only oneA/D channel, one PWM channel, and 11 I/O pins are actually required (see Figure 3). The decision was made to err on the safe side because a complete development system specific to the chosen part was necessary, and the project budget did not permit a second such system to be purchased should the firstprove inadequate.Microcontroller Application Development. Breadboarding of the peripheral hardware, development of microcontroller software, and final debugging and testing of a customprinted-circuit board for the microcontroller and peripherals all require a development environment of some kind. The choice of a development environment, like that of themicrocontroller itself, can be bewildering and requires some faculty expertise. Motorola makes three grades of development environment ranging from simple evaluation boards (at around $100) to full-blown real-time in-circuit emulators (at more like $7500). The middle option was chosen for this project: the MMEVS, which consists of _ a platform board (which supports all 6805-family parts), _ an emulator module (specific to B-series parts), and _ a cable and target head adapter (package-specific). Overall, the system costs about $900 and provides, with some limitations, in-circuit emulation capability. It also comes with the simple but sufficient software development environment RAPID [5].Students find learning to use this type of system challenging, but the experience they gain in real-world microcontroller application development greatly exceeds the typical first-course experience using simple evaluation boards.Printed-Circuit Board. The layout of a simple (though definitely not trivial) printed-circuit board is another practical learning opportunity presented by this project. The final board layout, with package outlines, is shown (at 50% of actual size) in Figure 8. The relative simplicity of the circuit makes manual placement and routing practical—in fact, it likely gives better results than automatic in an application like this—and the student is therefore exposed to fundamental issues of printed-circuit layout and basic design rules. The layout software used was the very nice package pcb,2 and the board was fabricated in-house with the aid of our staff electronics technician.5 ConclusionThe aim of this paper has been to describe an interdisciplinary, undergraduate engineering design project: a microcontroller- based temperature control system with digital set-point entry and set-point/actual temperature display. A particular design of such a system has been described, and a number of design issues which arise—from a variety of engineering disciplines—have been discussed. Resolution of these issues generally requires knowledge beyond that acquired in introductory courses, but realistically accessible to advance undergraduate students, especiallywith the advice and supervision of faculty.Desirable features of the problem, from a pedagogical viewpoint, include the use of a microcontroller with simple peripherals, the opportunity to usefully apply introductorylevel modeling of physical systems and design of closed-loop controls, and the need for relatively simple experimentation (for model validation) and simulation (for detailed performance prediction). Also desirable are some of the technologyrelated aspects of the problem including practical use of resistive heaters and temperature sensors (requiring knowledge of PWM and calibration techniques, respectively), microcontroller selection and use of development systems, and printedcircuit design.AcknowledgementsThe author would like to acknowledge the hard work, dedication, and ability shown by the students involved in this project: Mark Langsdorf, Matt Rall, PamRinehart, and David Schuchmann. It is their project, and credit for its success belongs to them.References[1] M. Langsdorf, M. Rall, D. Schuchmann, and P. Rinehart,―Temperature control of a microscope slide dryer,‖ in1997 National Conference on Undergraduate Research,(Austin, TX), April 1997. Poster presentation.[2] Motorola, Inc., Phoenix, AZ, Temperature Measurementand Display Using the MC68HC05B4 and the MC14489,1990. Motorola SemiconductorApplicationNote AN431.[3] Motorola, Inc., Phoenix, AZ, HC05 MCU LED DriveTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1238.[4] Motorola, Inc., Phoenix, AZ, HC05MCU Keypad DecodingTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1239.[5] Motorola, Inc., Phoenix, AZ, RAPID Integrated DevelopmentEnvironment User’s Manual, 1993. (RAPID wasdeveloped by P & E Microcomputer Systems, Inc.).单片机温度控制:一个跨学科的本科生工程设计项目JamesS.McDonald工程科学系三一大学德克萨斯州圣安东尼奥市78212摘要本文所描述的是作者领导由四个三一大学高年级学生组成的团队进行的一个跨学科工程项目的设计。
基于PC机多通路温度采集系统外文资料-翻译
外文资料及翻译Microprocessor13.1 IntroductionMicroprocessor is an electronic circuit that functions as the central processingunit (CPU) of a computer , providing computational control. Microprocessorsare also used in other advanced electronic systems, such as computer printers,automobiles, and jet airlines. In 1995 about 4 billion microprocessors were produced worldwide.The microprocessor is one type of ultra-large-scale integrated circuit.Integrated circuits, also known as microchips or single, thin, flat piece of material known as a semiconductor. Modern microprocessors incorporate asmany as ten million transistors(which act as electronic amplifiers, oscillators,or, most commonly, switches ),in addition to other components such asresistors, diodes, capacitors, and wires, all packed into an area about the sizeof postage stamp.A microprocessor consists of several different sections: thearithmetic/logic unit (ALU) performs calculations on numbers and makeslogical decisions; the registers are special memory locations for storingtemporary information much as a scratch pad does; the control unit deciphersprograms; bused carry digital information throughout the chip and computer; and local memory supports on-chip computation. More complex microprocessors often contain other sections-such as sections of specialized memory, called cache memory, to speed up access to external data-storagedevices. Modern microprocessors operate with bus widths of 64 bits(binarydigits, or units of information represented as 1s and 0s),meaning that 64 bits of data can be transferred at the same time. A crystal oscillator in the computer provides a clock signal to coordinate all activities of the microprocessor. The clock speed of the most advanced microprocessors is about 300 megahertz(MHz)-about 300 million cycles per second-allowing about a billion computer instructions to be executed every second. 13.2 Computer MemoryBecause the microprocessor alone cannot accommodate the large amountof memory required to store program instructions and data, such as the text in aword-processing program, transistors can be used as memory elements in combination with the microprocessor. Separate integrated circuits, called random-access memory. Static RAM(SRAM) holds information as long as power is turned on and is usually used as cache memory because it operates very quickly. Another type of memory, dynamic RAM(DRAM), is slower than SRAM and must be periodically refreshed with electricity or the information it holds is lost. DRAM is more economical than SRAM and serves as the main memory element in most computers.13.3 MicrocontrollerA microprocessor is not a complete computer. It does not contain large amounts of memory or have the ability to communicate with input devices-such as keyboards, joy-sticks, and mice-or with output devices, such as monitors and printers. A different kind of integrated circuit, a microcontroller, is a complete computer on a chip, containing all microcontrollers are used in video games, videocassette recorders (VCRs),automobiles, and other machines.13.4 SemiconductorsAll integrated circuits are fabricated from semiconductors, substance whose ability to conduct electricity ranks between that of a conductor and that of a nonconductor, or insulator. Silicon is the most common semiconductor material. Because the electrical conductivity of a semiconductor can change according to the voltage applied to it, transistors made from semiconductors act like tiny switches that turn electrical current on and off in just a few nanoseconds (billionths of a second). This capability enables a computer to perform many millions of simple instructions each second and to complete complex tasks quickly.The basic building block of most semiconductor devices is the diode, a junction, or union, of negative-type (n-type) and positive-type (p-type) materials. The terms n-type and p-type refer to semiconducting materials that have been doped-that is , that have had their electrical properties altered by the controlled addition of very small quantities of impurities such as boron or phosphorus. In a diode, current flows in only one direction: across the junction from the p- to n-type material, and then only when the p-type material is at a higher voltage than the n-type. The voltage applied to thediode to create this condition is called the forward bias, the opposite voltage, for which current will not flow, is called the reverse bias. An integrated circuit contains mullions of p-n junctions, each serving a specific purpose within the millions of electronic circuit elements. Proper placement and biasing of p- and n- type regions restrict the electrical current to the correct paths and ensure the proper operation of the entire chip.13.5 TransistorsThe transistor used most commonly in the microelectronics industry is called a metal-oxide-semiconductor field effect transistor (MOSFET). It contains two n-type regions, called the source and the drain, with a p-typeregion in between them, called the channel. Over the channel is a thin layer of nonconductive silicon dioxide topped by another layer, called the gate. For electrons to flow from the source to the drain, a voltage (forward bias) must be applied to the gate. This causes the gate to act like a control switch, turning the MOSFET on and off and creating a logic gate that transmits digital 1s and 0s throughout the microprocessor.13.6 Construction of MicroprocessorsMicroprocessors are fabricated using techniques similar to those used forother integrated circuits, such as memory chips. Microprocessors generally have a more complex structure than do other chips, and their manufacture requires extremely precise techniques. Economical manufacturing of microprocessors requires mass production. Several hundred dies, or circuit patterns, are created on the surface of a silicon wafer simultaneously. Microprocessors are constructed by a process of deposition and removal of conducting, insulating, and semiconducting materials, one thin layer at a time until, after hundreds of separate steps, a complex sandwich is constructed that contains all the interconnected circuitry of the microprocessor. Only the outer surface of the silicon wafer-a layer about 10 microns ( about 0.01mm/0.0004 in) thick (about one-tenh the thickness of a human hair)-is used for the electronic circuit. The processing steps include substrate creation, oxidation, lithography, etching, ion implantation, and film deposition. The first step in producing a microprocessor is the creation of an ultrapure silicon substrate, a silicon slice in the shape of a roundwafer that is polished to a mirror like smoothness. At present, the largest wafers used in industry are 200mm (4 in) in diameter.In the oxidation step, an electrically nonconducting layer, called a dielectric, is placed between each conductive layer on the wafer. The most important type of dielectric is sillicon dioxide, which is ‘grown’ by exposing the sillicon wafer to oxygen in a furnace at about C 1000 (about F 1800 ).The oxygen combines with silicon to form a thin layer of oxide about 75 angstroms deep (an angstrom is one ten-billionth of a meter . Nearly every layer that is deposited on the wafer must be patterned accurately into the shape of the transistors and other electronic elements. Usually this is done in piece of photographic film and projecting a picture of the circuit on it. A coating on the surface of the wafer, called the photoresist or resist, changes when exposed to light, making it easy to dissolve in a developing solution. These patterns are as small as 0.25 microns in size. Because the shortest wavelength of visible light is about 0.5 microns, Short-wave-length ultraviolet light must be used to resolve the tiny details of the patterns. After photolithography, the wafer is etched-that is, the resist is removed from the wafer either by chemicals, in a process known as wet etching, or by exposure to a corrosive gas, called a plasma, in a special vacuum chamber.In the next step of the process, ion implantation, impurities such as boron and phosphorus are introduced into the silicon to alter its conductivity. This is accomplished by ionizing the boron or phosphorus atoms( stripping off one or two electrons) and propelling them at the wafer with an ion implanter at very high energies. The ions become embedded in the surface of the wafer. The thin layers used to build up a microprocessors are referred to as films. In the final step of the process, the films are deposited using sputterers in which thin films are grown in a plasma; by means of evaporation, whereby the material is melted and then evaporated coating the wafer; or by means of chemical-vapor deposition, whereby the material condense from a gas at low or atmospheric pressure. In each case, the film must be of high purity and its thickness must be controlled within a small fraction of a micron. Microprocessor features are so small and precise that a single speck of dust candestroy an entire die. The rooms used for microprocessor creation are called clean rooms because the air in them is extremely well filtered and virtually free of dust. The purest of todays clean rooms are referred to as class 1,indicating the maximum number of allowed particles larger than 0.12 micron in one cubic foot of air,(For comparison, a typical home is class one million or so, )13.7 History of the MicroprocessorThe first microprocessor was the Intel 4004, produced in 1971.Originally developed for a calculator, and revolutionary for its time, it contained 2,300 transistors on a 4-bit microprocessor that could perform only 60,000 operations per second. The first 8-bit microprocessor was the Intel 8008, developed in 1972 to run computer terminals. The Intel 8008 contained 3,300 transistors. The first truly general-purpose microprocessor, developed in 1974, was the 8-bit Intel 8080(see microprocessor, 8080), which contained 4,500 transistors and could execute 200,000 instructions per second. Modern microprocessor have much greater capacity and speed. They include the Intel Pentium Pro, containing 5.5 million transistors; the UltraSparc-Ⅱ, by SunMicrosystems, containing 5.4 million transistors; the PowerPC620, developed jointly by Apple, IBM, and Motorola, and containing 7 million transistors; and the Digital Equipment Corporation’s Alpha 21164A, containing 9.3 million transistors.13.8 Future TechnologyThe technology of microprocessors and integrated-circuit fabrication ischanging rapidly. Currently, the most sophisticated microprocessors contain about ten million transistors. By the year 2000, advanced microprocessors are expected to contain more than 50 million transistors, and about 800 million by 2010. Lithographic techniques will also require improvements. By the year 2000, minimum element size will be less than 0.2 microns. At these dimensions, even short-wave-length ultraviolet light may not reach the necessary resolution. Alternative possibilities include using very narrow beams of electrons and ions or replacing optical lithography with lithography that uses X rays of extremely short wavelength. Using these technologies, clock speeds could increase to more than 1,000 MHz by2010. It is expected that the limiting factor in microprocessor performance will be the behavior of the electrons themselves as they are propelled through the transistors. At extremely small dimensions, quantum effects due to the wavelike nature of electrons could dominate the behavior of transistors and circuits. New devices and circuit designs may be necessary as microprocessors approach atomic dimensions. Techniques including molecular-beam epitaxy, in which semiconductors are layered one atom at a time in an ultra-high-vacuum chamber, and scanning tunneling microscopy, whereby single atoms can be viewed and even moved with atomic precision, may be the tools needed to produce future generations of microprocessors.微处理器13.1 前言微处理器是一个电子电路,其功能相当于计算机的中央处理单元,提供计算的控制。
基于单片机的无线多路温度数据采集系统设计
关键词: AT89C51 温度采集温度传感器DS18B20 RS-232 MAX813 无线收发模块PTR2000AbstractThis paper introduces a kind of wireless monitoring system which is used to control temperature condition. The system adopts wireless network and temperature collect technique. The wireless communication can avoid the shortcoming of remote wire transmission, such as large wastage, high cost etc. This design usesAT89C51,The monolithic integrated circuit is the main hardware, In order to realize design goal this design including temperature gathering, the temperature demonstrated that, the systems control, strung together periphery electric circuit and so on mouth correspondence.The main MCU (AT89C51) takes charge of measurement,control andcommunication with the communication MCU. The communication MCU (AT89C51) is used to control receiving and sending data in the wireless communication. The system wireless 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.Key words:AT89C51Temperature gatheringDS18B20RS-232MAX813PTR2000wireless communication目录第一章绪论 (3)第二章方案论证4第三章系统总体设计63.1系统总体分析63.2设计原理7第四章各个元器件及芯片简介94.1 AT89C51单片机介绍94.2 DS18B20温度传感器简介114.3 PTR2000模块介绍124.4 MAX813芯片介绍134.5 MAX7219芯片介绍144.6 1602液晶显示屏介绍15第五章各部分电路设计165.1 看门狗电路165.2 温度采集电路175.3 串口电路185.4 显示电路195.5 键盘电路20第六章系统总体软件设计 (21)6.1 系统工作流程.................................................216.2 系统地软件设计 (21)6.3 软件设计流程图 (22)结论27致谢词28参考文献29附录1:硬件总图30第一章绪论在工农业生产中,对于采集数据地传输大多采用有线方式,因为有线方式地传输距离、数据传输速率以及抗干扰能力都要优于无线方式;然而对于在野外或者不便于铺设线缆地地区进行数据采集传输时,采用有线方式就受到了限制.针对这一特点,设计了采用无线传输方式地无线数据采集监测系统.该系统采集主要以Atmel公司地AT89C51单片机为控制处理核心,由它完成对数据地采集处理以及控制数据地无线传输.AT89C51单片机是一种低功耗/低电压/高性能地8位单片机,片内带有一个8KB地可编程/可擦除/只读存储器.无线收发一体数传MODEM模块PTR2000芯片性能优异,在业界居领先水平,它地显著特点是所需外围元件少,因而设计非常方便.该模板块在内部需成了高频接收、PLL合成、FSK调制/解调、参量放大、功率放大、频道切换等功能,因而是目前集成度较高地无线数传产品.在本文中,主要说明单片机和无线数据收发模块 PTR 2000地组合,形成单片机地无线数据传输系统,与微机进行无线数据传输.包括:如何针对系统地需求选择合适地无线数据传输模块器件,如何根据选择地器件设计外围电路和单片机地接口电路,如何编写控制无线数据传输器件进行数据传输地单片机程序,并简要介绍数字温度传感器DS18B20地应用.第二章方案论证(一)温度采集方案方案一:模拟温度传感器.采用热敏电阻,将温度值转换为电压值,经运算放大器放大后送A/D转换器将模拟信号变换为数字信号,再由单片机经过比较计算得到温度值.优点:应用广泛,特别是工程领域,采用不同地热敏电阻,可实现低温到超高温地测量.缺点:必须采用高速高位A/D转换器,系统复杂,成本高,还以引进非线性误差,得通过软件差值修正方案二:采用集成数字温度传感器DS18B20.该传感器采用单总线接口,能方便地与单片机通信.测温范围从-55到+125,测温精度9-12位可调,12位时最大转换时间为750ms,完全满足本设计地要求.缺点:不能实现高温测量.从上各种因素,我们采用数字温度传感器方案.(二)无线数据传送方案方案一:采用GSM模块.GSM(公用数字移动网通信)系统是目前基于时分多址技术地移动通讯体制中比较成熟、完善、应用最广泛地一种系统,本设计可利用其短消息服务来传输温度数据.优点:网络覆盖广,可实现远距离传输.缺点:成本高,无法实现实时性.方案二:该采用无线传输模块PTR2000.该器件将接收和发射合接为一体;工作频率为国际通用地数传频段433MHZ;采用FSK调制/解调,可直接进入数据输入/输出,抗干扰能力强,特别适合工业控制场合;采用DDS(直接数据合成)+PLL频率合成技术,因而频率稳定性极好;灵敏度高达—105bBm;工作电压低(2.7V),功耗小,接受待机状态电流仅为8μA;具有两个频道,可满足需要多信道工作地场合;工作数率最高达20kbit/s(也可在较抵速率下工作,如9600bps);超小体积,约40×27×5mm3;可直接与CPU串口进行连接(如8031),也可以用RS232与计算机接口,软件编程非常方便基于上述考虑,采用方案二.(三)显示界面方案方案一:用数码管显示,优点:结构简单,成本低.缺点:只能显示一测量点和有限地符号.方案二:采用LCD显示.可以实现中英文操作提示,方便人机交换.能同时显示多点温度值,通过键盘操作可快速翻屏浏览或监控一测量点温度值.缺点:价格高,体积增大.本系统设计为多点温度采集情况,所以选择LCD显示第三章系统总体设计3.1 系统总体分析无线温度数据采集系统是一种基于单片机射频技术地无线温度检测装置,本设计由温度采集部分,发送/接受部分,显示部分组成,温度采集部分由八个一线式数字温度传感器、AT89C51单片机、看门狗电路、键盘电路、晶振电路、复位电路、报警电路、数码管显示电路组成,采集到地温度数据在单片机地处理下在数码管上显示,同时传输到接收单元.发送部分采用无线传输模块PTR2000,模块在内部集成了高频发射,高频接受,PLL合成,FSK调制、参量放大,功率放大,频道切换等功能,单片机不能与无线模块直接通信,需通过串口电路进行数据地传输,串口电路采用RS232串口通信电路,显示部分采用1602液晶显示屏,AT89C51单片机以及单片机地外围电路由独立按键电路,晶振电路,复位电路组成.系统设计框图如下:发送模块系统框图接收模块系统框图3.2设计原理无线温度采集系统是一种基于无线模块地温度检测装置.本系统由温度采集部分和接收/发送机,以及显示芯片组成.温度采集部分由八个数字温度传感器芯片18B20,单片机AT89C51,低功耗地无线收发模块等组成,传感器采用寄生电源地方式即VDD与GND同时接地,八个温度传感器串接在P1.1口,同时采用结型场效应管进行驱动;数字单总线温度传感器是目前最新地测温器件,它集温度测量,A/D 转换于一体,具有单总线结构,数字量输出,直接与微机接口等优点.打开电源后,本系统由单片机AT89C51向单线数字温度传感器DS18B20芯片发出指令进行测温根据DS18B20地通讯协议,主机控制DS18B20完成温度转换必须经过三个步骤:每一次读写之前都要对DS18B20进行复位,复位成功后发送一条ROM指令,最后发送RAM指令,这样才能对DS18B20进行预定地操作.复位要求主CPU将数据线下拉500微秒,然后释放,DS18B20收到信号后等待16~60微秒左右,后发出60~240微秒地存在低脉冲,主CPU收到此信号表示复位成功.在硬件上,DS18B20与单片机地连接采用寄生电源供电,此时UDD、GND接地,I/O接单片机I/O.然后数据被传输至单片机AT89C51,八位数据分两次传输,再由单片机编程为可以由数码管显示地四位数据,因为51单片机有一个全双工地串行通讯口,所以单片机和无线收发模块之间进行串口通讯.进行串行第一位为正负温度数据,后三位为带小数点地当前温度.数据也被送至低功耗无线传输模块进行无线传输.通讯时要满足一定地条件,比如电脑地串口是RS232电平地,而单片机地串口是TTL电平地,两者之间必须有一个电平转换电路,我们采用了专用芯片MAX232进行转换.温度数据地无线传输主要基于低功耗无线传输模块PTR2000,无线数据传输模块地关键器件是无线收发芯片,本设计选择了NFR401系列地芯片,PTR2000地通信速率最高为20BIT/S, PTR2000无线数据传输模块可以利用串口进行数据地传输有三种工作模式1,发送在发送数据之前,应将模块先置于发射模式,即TXEN=1.然后等待至少5ms后(接收到发射地转换时间)才可以发送任意长度地数据.发送结束后应将模块置于接收状态,即TXEN=0.2, 接收:接收时应将PTR2000置于接收状态,即TXEN=0.然后将接收到地数据直接送到单片机串口.3,待机:当PWR=0时,PTR进入节点模式,此时地功耗大约为8uA,但在待机模式下不能接收和发射数据.数据地收、发由AT89C51控制.首先,对系统要进行初始化,让NRF401进入待机状态:使单片机工作在串口通信方式,利用单片机地中断响应,对NRF40l芯片地相应引脚进行控制,实现数据地接收或发射.数据经过无线传输及接收后再被传输至接受端地AT89C51单片机中,然后再由单片机将数据转化为可以由液晶显示板1602显示地数据.1602液晶显示模块是一个慢显示器件,所以在执行每条指令之前一定要确认模块地忙标志为低电平,表示不忙,否则此指令失效.要显示字符时要先输入显示字符地址,也就是告诉模块在哪里显示字符. 最后通过液晶显示屏和数码管地温度数据对比,判断进行无线地温度传输数据是否正确.第四章各个元器件及芯片简介4.1 AT89C51单片机介绍AT89C51单片机简介AT89C51是一种带4K字节闪烁可编程可擦除只读存储器(FPEROM—Falsh Programmable and Erasable Read Only Memory)地低电压,高性能CMOS8位微处理器,俗称单片机.单片机地可擦除只读存储器可以反复擦除100次.该器件采用ATMEL高密度非易失存储器制造技术制造,与工业标准地MCS-51指令集和输出管脚相兼容.由于将多功能8位CPU和闪烁存储器组合在单个芯片中,ATMEL 地AT89C51是一种高效微控制器,AT89C2051是它地一种精简版本.1.主要特性:1、与MCS-51 兼容2、4K字节可编程闪烁存储器3、1000写/擦循环数据保留时间10年4、全静态工作,0Hz-24Hz·三级程序存储器锁定5、128*8位内部RAM32可编程I/O线6、两个16位定时器/计数器7、5个中断源8、可编程串行通道低功耗地闲置和掉电模式9、片内振荡器和时钟电路2.主要管脚说明:P0口:P0口为一个8位漏级开路双向I/O口,每脚可吸收8TTL门电流.当P1口地管脚第一次写1时,被定义为高阻输入.P0能够用于外部程序数据存储器,它可以被定义为数据/地址地第八位. P1口:P1口是一个内部提供上拉电阻地8位双向I/O口,P1口缓冲器能接收输出4TTL门电流.P1口管脚写入1后,被内部上拉为高,可用作输入,P1口被外部下拉为低电平时,将输出电流,这是由于内部上拉地缘故.P2口:P2口为一个内部上拉电阻地8位双向I/O口,P2口缓冲器可接收,输出4个TTL门电流,当P2口被写“1”时,其管脚被内部上拉电阻拉高,且作为输入.并因此作为输入时,P2口地管脚被外部拉低,将输出电流.P2口当用于外部程序存储器或16位地址外部数据存储器进行存取时,P2口输出地址地高八位.P3口:P3口管脚是8个带内部上拉电阻地双向I/O口,可接收输出4个TTL门电流.当P3口写入“1”后,它们被内部上拉为高电平,并用作输入.作为输入,由于外部下拉为低电平,P3口将输出电流(ILL)这是由于上拉地缘故.4.2 DS18B20温度传感器简介DS18B20是DALLAS公司生产地一线式数字温度传感器,具有3引脚TO-92小体积封装形式;温度测量范围为-55℃~+125℃可编程为9位~12位A/D 转换精度,测温分辨率可达 0.0625℃,被测温度用符号扩展地16位数字量方式串行输出;其工作电源既可在远端引入,也可采用寄生电源方式产生;多个DS18B20可以并联到3 根或2根线上,CPU只需一根端口线就能与诸多DS18B20通信,占用微处理器地端口较少,可节省大量地引线和逻辑电路.以上特点使DS18B20非常适用于远距离多点温度检测系统.DS18B20地内部结构主要由4部分组成:64 位ROM、温度传感器、非挥发地温度报警触发器TH和TL、配置寄存器.DS18B20地管脚排列如图2所示,DQ 为数字信号输入/输出端;GND为电源地;VDD为外接供电电源输入端.ROM中地64位序列号是出厂前被光刻好地,它可以看作是该DS18B20地地址序列码,每个DS18B20地64位序列号均不相同.64位ROM地排地循环冗余校验码(CRC=X8+X5+X4+1). ROM地作用是使每一个DS18B20都各不相同,这样就可以实现一根总线上挂接多个DS18B20地目地.图1DS18B20地管脚图DS18B20中地温度传感器完成对温度地测量,用16位符号扩展地二进制补码读数形式提供,以0.0625℃/LSB形式表达,其中S为符号位.例如+125℃地数字输出为07D0H,+25.0625℃地数字输出为0191H,-25.0625℃地数字输出为FF6FH,-55℃地数字输出为 FC90H.高低温报警触发器TH和TL、配置寄存器均由一个字节地EEPROM组成,使用一个存储器功能命令可对TH、TL或配置寄存器写入. R1、R0决定温度转换地精度位数:R1R0=“00”,9位精度,最大转换时间为93.75ms;R1R0=“01”,10位精度,最大转换时间为 187.5ms;R1R0=“10”,11位精度,最大转换时间为375ms;R1R0=“11”,12位精度,最大转换时间为750ms;未编程时默认为12位精度.高速暂存器是一个9字节地存储器.开始两个字节包含被测温度地数字量信息;第3、4、5字节分别是TH、TL、配置寄存器地临时拷贝,每一次上电复位时被刷新;第6、7、8字节未用,表现为全逻辑1;第9字节读出地是前面所有8个字节地CRC码,可用来保证通信正确.4.3 PTR2000模块介绍无线数据收发模块ptr2000采用抗干扰能力较强地FSK调制/解调方式,其工作频率稳定可靠,外围元件少、功耗极低且便于设计生产,这些有一些特性使得PTR2000非常适用于便携机手持产品.可广泛用于遥控、遥测、小型无线网络、无线抄表、门禁系统、小区传呼、工业数据采集、无线标签等系统.无线数据传输模块地关键器件是无线收发芯片.以下是几点选择芯片或者模块地选择标准.收发芯片数据传输地编码方式采用曼彻斯特编码地芯片,在编程上会需要较高地技巧和经验,需要更多地内存和程序容量,并且曼彻斯特编码大大降低数据传输地效率,一般仅能达到标称速率地1/3.而采用串口传输地芯片,如NRF401系列地芯片,应用及编程非常简单,传输速率很高,标称速率就是实际速率,因为串口地编程相对简单,编程开发工作也很方便.收发芯片地分装和管脚数较小地管脚以及分装,有利于较少PCB面积,适合测控地设计.NRF401仅20脚,是管脚和体积最小地.同时NRF401还具有以下特点:工作频率为国际通用地数据频段433MHZ;采用FSK调制,直接数据输入输出,抗干扰能力强,特别适用工业控制场合,采用DSS+PLL频率合成技术,频率稳定性极好,灵敏度高达-105dBm;功耗小接受待机状态时,电流仅为8UA,最大发射功率为10dBm,低工作电压(2.7V)可满足低功耗设备地要求,具有多个频道,可方便地切换工作频率特别适用于需要多信道工作地场合,工作速率最高可达20kbit/s,仅外接一个好、晶振和几个阻容、电感元件,基本无需调试,由于采用了低发射功率、高接收灵敏度地设计,适用距离最远可达1000M.内部电路图如下:4.4 MAX813芯片介绍看门狗电路在单片机中以加电、掉电以及供电电压下降情况下地复位输出,复位脉冲宽度典型值为200 ms.独立地看门狗输出,如果看门狗输入在1.6 s内未被触发,其输出将变为高电平, 1.25 V门限值检测器,用于电源故障报警、电池低电压检测或+5 V 以外地电源监控,低电平有效地手动复位输入.各引脚功能及工作原理1、手动复位输入端()当该端输入低电平保持140 ms以上,MAX813就输出复位信号.该输入端地最小输入脉宽要求可以有效地消除开关地抖动.2、工作电源端(VCC):接+5V电源.3、电源接地端(GND):接0 V参考电平..4、电源故障输入端(PFI)当该端输入电压低于1.25 V时,5号引脚输出端地信号由高电平变为低电平.5、电源故障输出端()电源正常时,保持高电平,电源电压变低或掉电时,输出由高电平变为低电平.6、看门狗信号输入端(WDI)程序正常运行时,必须在小于1.6 s地时间间隔内向该输入端发送一个脉冲信号,以清除芯片内部地看门狗定时器.若超过1.6 s该输入端收不到脉冲信号,则内部定时器溢出,8号引脚由高电平变为低电平.7、复位信号输出端(RST)上电时,自动产生200 ms地复位脉冲;手动复位端输入低电平时,该端也产生复位信号输出.8、看门狗信号输出端().正常工作时输出保持高电平,看门狗输出时,该端输出信号由高电平变为低电平.芯片管脚图如下:4.5 MAX7219芯片介绍MAX7219是Maxim公司推出地8位LED串行显示驱动器,它采用3线串口传送数据,占用资源少且硬件简单,只需一个外部电阻即可方便地调节LED地亮度;可灵活地选择显示器地个数( 1~8个, 级联可成倍增加);可进行译码或不译码显示;内含硬件动态扫描控制,可设置低功耗停机方式.引脚功能和工作原理MAX7219采用24脚双列直插式封装,其引脚如图3所示.SEGA~SEGG和DP 分别为LED七段驱动器线和小数点线,供给显示器源电流;DIG0~DIG7为8位数字驱动线,输出位选信号,从每位LED共阴极吸入电流.图3 MAX7219 引脚功能DIN是串行数据输入端.在CLK 地上升沿,一位数据被加载到内部16位移位寄存器中,CLK最高频率可达10MHz,由DIN端移入到内部寄存器中;LOAD用在LOAD地上升沿,16位串行数据被锁存到数据或控制寄存器中,LOAD必须在第16个时钟上升沿地同时或之后、在下一个时钟上升沿之前变高, 否则数据将被丢失.每组数据为16 位二进制数据包.其中D15~D12位不用,D11~D8位为内部5个控制寄存器和8个LED显示数据寄存器地地址,D7~D0位为5个控制寄存器和8个LED数码管待显示地数据,因为控制寄存器与显示数据寄存器独立编址,所以可以通过程序对每个寄存器进行操作.MAX7219内部有14个可寻址地控制字寄存器.MAX7219是八位串行共阴LED数码管动态扫描驱动电路,其峰值段电流可达40mA,最高串行扫描速率为10MHz,典型扫描速率为1300Hz,仅使用单片机3个I/O口,即可完成对八位LED数码管地显示控制和驱动, 线路非常简单,控制方便,外围电路仅需一个电阻设定峰值段电流,同时可以通过软件设定其显示亮度;还可以通过级联,完成对多于八位地数码管地控制显示.值得一提地是,当工作于关闭(SHUTDOWN)方式时,不仅单片机仍可对其传送数据和修改控制方式,而且芯片耗电仅为150uA.4.6 1602液晶显示屏介绍工业字符型液晶,能够同时显示16x02即32个字符.(16列2行)注:为了表示地方便 ,后文皆以1表示高电平,0表示第电平.1.管脚功能1602采用标准地16脚接口,其中:第1脚:VSS为电源地第2脚:VDD接5V电源正极第3脚:V0为液晶显示器对比度调整端,接正电源时对比度最弱,接地电源时对比度最高(对比度过高时会产生“鬼影”,使用时可以通过一个10K地电位器调整对比度).第4脚:RS为寄存器选择,高电平1时选择数据寄存器、低电平0时选择指令寄存器. 第5脚:RW为读写信号线,高电平(1)时进行读操作,低电平(0)时进行写操作.第6脚:E(或EN)端为使能(enable)端.第7~14脚:D0~D7为8位双向数据端.第15~16脚:空脚或背灯电源.15脚背光正极,16脚背光负极.2.字符集1602液晶模块内部地字符发生存储器(CGROM)已经存储了160个不同地点阵字符图形,这些字符有:阿拉伯数字、英文字母地大小写、常用地符号、和日文假名等,每一个字符都有一个固定地代码,比如大写地英文字母“A”地代码是01000001B(41H),显示时模块把地址41H中地点阵字符图形显示出来,我们就能看到字母“A”.第五章各部分电路设计5.1 看门狗电路本设计中看门狗电路主要用到MAX813芯片,及其他外围电路,在设计中看门狗电路地工作原理是:当系统工作正常时,CPU将每隔一定时间输出一个脉冲给看门狗,即“喂狗”,若程序运行出现问题或硬件出现故障时而无法按时“喂狗”时,看门狗电路将迫使系统自动复位而重新运行程序.主要作用是防止程序跑飞或死锁.看门狗电路其实是一个独立地定时器,有一个定时器控制寄存器,可以设定时间(开狗),到达时间后要置位(喂狗),如果没有地话,就认为是程序跑飞,就会发出RESET指令,当为高电平时,开始复位.功能如下:本电路巧妙地利用了MAX813地手动复位输入端.只要程序一旦跑飞引起程序“死机”,端电平由高到低,当变低超过140 ms,将引起MAX813产生一个200 ms地复位脉冲.同时使看门狗定时器清0和使引脚变成高电平.也可以随时使用手动复位按钮使MAX813产生复位脉冲,由于为产生复位脉冲端要求低电平至少保持140ms以上,故可以有效地消除开关抖动.该电路可以实时地监视电源故障(掉电、电压降低等).图6 中R5未经稳压地直流电源.电源正常时,确保R3地电压高于1.26 V,即保证MAX813地PFI 输入端电平高于1.26 V.当电源发生故障,PFI输入端地电平低于1.25 V时,电源故障输出端电平由高变低,引起单片机中断,CPU响应中断,执行相应地中断服务程序,保护数据,断开外部用电电路等.5.2 温度采集电路温度采集部分主要用到八个数字温度传感器DS18B20, 因为支持一线总线接口,可将八个温度传感器串接在一起,接在P1.1口,采用寄生电源方式,将VDD 与GND共同接地,同时采用一结型场效应管进行驱动.温度传感器将采集到地信号送到单片机中,信号在单片机种进行处理,存储,通过键盘电路中所按下地按键,数据将在数码管显示屏中显示,这里所用到地数码管为共阴极数码管,共四个,第一个显示温度地符号(+或-)其余三个显示所测温度值,温度范围为(-55℃—125℃),采用MAX7219芯片驱动数码管,通过片选选择数码管地个数,段选选择数码管地八个引脚,这种设计简单且用到地端口较少,一目了然,同时当温度超过此范围,报警电路将会发出警告,提醒人们温度值过大.同时信号也将被送至无线收发模块.电路图如下:温度采集电路原理图5.3 串口电路单片机从一个I/O引脚逐位传输一些列二进制编码数据,就是串行通信.所谓串行通信是指外设和计算机家门适用一根数据信号线数据在一根数据信号线上一位一位地进行传输,每一位数据都占据一个固定地时间长度,这种通信方式使用地数据线少,传输速度比并行传输慢.串行通信地优点在于远程通信和上下位机通信,51系列单片机通过自身地串口完成通信,高串口是一个可编程地全双工串行通信接口.串口通信协议地内容接口地电气特性在RS-232-C中任何一条信号线地电压均为负逻辑关系.即要求接收器能识别低至+3V地信号作为逻辑“0”,高到-3V地信号作为逻辑“1”.接口地物理结构 RS-232-C接口连接器一般使用型号为DB-25地25芯插头座,通常插头在DCE端,插座在DTE端. 一些设备与PC机连接地RS-232-C接口,因为不使用对方地传送控制信号,只需三条接口线,即“发送数据”、“接收数据”和“信号地”.所以采用DB-9地9芯插头座,传输线采用屏蔽双绞线. 串口电路图如下:C2 0.1uf C1 0.1ufc30.1ufc40.1ufC50.1ufVCC单片机的TXD单片机的RXD单片机和其串口电平转换芯片的连接电路235SJ1RS232信号123C1+1C1-2C2+3C2-4T1IN5T2IN6R1OUT7V+14V-13T2OUT11R1IN10R2IN9T1OUT12R2OUT81615VCCGNDMAX2025.4 显示电路显示电路主要有另一块AT89C51单片机、外围电路及1602液晶显示屏组成.1602液晶显示屏能显示32个字符,内部地字符发生存储器(CGROM)已经存储了160个不同地点阵字符图形,这些字符有:阿拉伯数字、英文字母地大小写、常用地符号、和日文假名等,当数据传输过来时,液晶屏地第一行显示温度两字,第二行显示温度数值.电路图如下:显示模块。
(完整word版)单片机_温度控制系统_外文翻译_外文文献_英文文献_中英翻译
Design of the Temperature Control System Based on AT89C51ABSTRACTThe 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;temperature1 INTRODUCTIONTemperature is a very important parameter in human life。
单片机-温度控制系统-外文翻译-外文文献-英文文献-中英翻译
Design of the Temperature Control System Based on AT89C51ABSTRACTThe 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;temperature1 INTRODUCTIONTemperature 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。
单片机温度控制系统外文翻译外文文献英文文献中英翻译
Design of the Temperature Control System Based onAT89C51ABSTRACTThe 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 INTRODUCTIONTemperature 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; andautomatically 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 IntroductionThe 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, mistakesare 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 features4Kbytes 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 oscil–lator disabling all other chip functions until the next hardware reset.1.3Pin DescriptionVCC 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 (MOVX@DPTR). 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 skippedduring 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 accessto 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 ModeIn 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 AlgorithmBefore 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 more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object reached. Data Polling: The AT89C51features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.2.1Ready/Busy:The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY.Program Verify:If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.2.2 Chip Erase:The entire Flash array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.2.3 Reading the Signature Bytes:The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned areas follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programming2.4 Programming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. A microcomputer interface converts information between two forms. Outside the microcomputer the information handled by an electronic system exists as a physical signal, but within the program, it is represented numerically. The function of any interface can be broken down into a number of operations which modify the data in some way, so that the process of conversion between the external and internal forms is carried out in a number of steps. An analog-to-digital converter(ADC) is used to convert a continuously variable signal to a corresponding digital form which can take any one of a fixed number of possible binary values. If the output of the transducer does not vary continuously, no ADC is necessary. In this case the signal conditioning section must convert the incoming signal to a form which can be connected directly to the next part of the interface, the input/output section of the microcomputer itself. Output interfaces take a similar form, the obvious difference being that here the flow of information is in the opposite direction; it is passed from the program to the outside world. In this case the program may call an output subroutine which supervises the operation of the interface and performs the scaling numbers which may be needed for digital-to-analog converter(DAC). This subroutine passes information in turn to an output device which produces a corresponding electrical signal, which could be converted into analog form using a DAC. Finally the signal is conditioned(usually amplified) to a form suitable for operating an actuator.The signals used within microcomputer circuits are almost always too small to be connected directly to the outside world” and some kind of interface must be used to translate them to a more appropriate form. The design of section of interface circuits is one of the most important tasks facing the engineer wishing to apply microcomputers. We have seen that in microcomputers information is represented as discrete patterns of bits; this digital form is most useful when the microcomputer is to be connected to equipment which can only be switched on or off, where each bit might represent the state of a switch or actuator. To solve real-world problems, a microcontroller must have more than just a CPU, a program, and a data memory. In addition, it must contain hardware allowing the CPU to access information from the outside world. Once the CPU gathers information and processes the data, it must also be able to effect change on some portion of the outside world. These hardware devices, called peripherals, are the CPU’s window to the outside.The most basic form of peripheral available on microcontrollers is the general purpose I70 port. Each of the I/O pins can be used as either an input or an output. The function of each pin is determined by setting or clearing corresponding bits in a corresponding data direction register during the initialization stage of a program. Each output pin may be driven to either a logic one or a logic zero by using CPU instructions to pin may be viewed (or read.) by the CPU using program instructions. Some type of serial unit is included on microcontrollers to allow the CPU to communicate bit-serially with external devices. Using a bit serial format instead of bit-parallel format requires fewer I/O pins to perform the communication function, which makes it less expensive, but slower. Serial transmissions are performed either synchronously orasynchronously.3 SYSTEM GENERAL DESIGNThe hardware block diagram of the TC is shown in Fig.1. The system hardware includes the micro controller, temperature detection circuit, keyboard control circuit, clock circuit, Display, alarm, drive circuit and external RAM. Based on the AT89C51, the DS18B20 will transfer the temperature signal detected to digital signal. And the signal is sent to the micro controller for processing. At last the temperature value is showed on the LCD 12232F. These steps are used to achieve the temperature detection. Using the keyboard interface chip HD7279 to set the temperature value, using the micro controller to keep a certain temperature, and using the LCD to show the preset value for controlling the temperature. In addition, the clock chip DS1302 is used to show time and the external RAM 6264 is used to save the monitoring data. An alarm will be given by buzzer in time if the temperature exceeds the upper and lower limit value of the temperature.3.1 HARDWARE DESIGNA. Micro controllerThe AT89C51 is a low-power, high-performance CMOS 8-bit micro controller with 4K bytes of in-system programmable Flash memory. The device is manufactured using At mel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the At mel AT89C51 is a powerful micro controller which provides a highly-flexible and cost-effective solution to many embedded controlapplications. Minimum system of the micro controller is shown in Fig. 2. In order to save monitoring data, the 6264 is used as an external RAM. It is a static RAM chip, low-power with 8K bytes memory.B. Temperature Detection CircuitThe temperature sensor is the key part in the system. The Dallas DS18B20 is used, which supports the 1-Wire bus interface, and the ON-BOARD Patented is used internally. All the sensor parts and the converting circuit are integrated in integrated circuit like a transistor [1]. Its measure range is -55℃~125 ℃, and the precision between -10℃~85℃is ±0.5℃[2 ,3]. The temperature collected by the DS18B20 is transmitted in the 1-Wire bus way, and this highly raises the system anti-jamming and makes it fit in situ temperature measurement of the rugged environment [4]. There are two power supply ways for the DS18B20. The first is external power supply: the first pin of the DS18B20 is connected to the ground; the second pin serves as signal wire and the third is connected to the power. The second way is parasite power supply [5]. As the parasite power supply will lead to the complexity of the hardware circuit, the difficulty of the software control and the performance degradation of the chip, etc. But the DS18B20(s) can be connected to the I/O port of the micro controller in the external power supply way and it is more popular. Therefore the external power supply is used and the second pin is connected to the pin P1.3 of the AT89S51. Actually, if there are multipoint to be detected, the DS18B20(s) can be connected to the 1-Wire bus. But when the number is over 8, there is a concern to the driving and the more complex software design as well as the length of the 1-Wire bus. Normally it is no more than 50m. To achieve distant control, the system can be designed in to a wireless one to break the length limit of the 1-Wire bus [6].C. LCD CircuitThe LCD 12232F is used, which can be used to show characters, temperature value and time, and supply a friendly display interface. The 12232F is a LCD with 8192 128×32 pixels Chinese character database and 128 16×8 pixels ASCII character set graphics. It mainly consists of row drive/column drive and 128×32 full lattice LCD with t he function of displaying graphics as well as 7.5×2 Chinese characters. It is in a parallel or serial mode to connect to external CPU [7]. In order to economize the hardware resource, the 12232F should be connected to the AT89S51 in serial mode with only 4 output ports used. The LCD grayscale can be changed by adjusting the variable resistor connected the pin Vlcd of the LCD. CLK is used to transmit serial communication clock. SID is used to transmit serial data. CS is used to enable control the LCD. L+ is used to control the LCD backlight power.D. Clock CircuitThe Dallas DS18B20 is used, which is a high performance, low-power and real-time clock chip with RAM. The DS18B20 serves in the system with calendar clock and is used to monitor the time. The time data is read and processed by the AT89C51 and then displayed by the LCD. Also the time can be adjusted by the keyboard. The DS18B20 crystal oscillator is set at 32768Hz, and the recommended compensation capacitance is 6pF. The oscillator frequency is lower, so it might be possible not to connect the capacitor, and this would not make a big difference to the time precision. The backup power supply can be connected to a 3.6V rechargeable battery.E. Keyboard Control CircuitThe keyboard interface in the system is driven by the HD7279A which has a +5V single power supply and which is connected to the keyboard and display without using anyactive-device. According to the basic requirements and functions of the system, only 6 buttons are needed. The system's functions are set by the AT89C51 receiving the entered data. In order to save the external resistor, the 1×6 keyboard is used, and the keyboard codes are defined as: 07H, 0FH, 17H, 1FH, 27H, 2FH. The order can be read out by reading the code instruction. HD7279A is connected to the AT89S51 in serial mode and only 4 ports are need. As shown in Fig. 6, DIG0~DIG5 and DP are respectively the column lines and row line ports of the six keys which achieve keyboard monitoring, decoding and key codes identification.F. Alarm CircuitIn order to simplify the circuit and convenient debugging, a 5V automatic buzzer is used in the alarm circuit [8]. And this make the software programming simplified. As shown in Fig. 7, it is controlled by the PNP transistor 9012 whose base is connected to the pin P2.5 of the AT89C51. When the temperature exceeds the upper and lower limit value, the P2.5 output low level which makes the transistor be on and then an alarm is given by the buzzer.G. Drive CircuitA step motor is used as the drive device to control the temperature. The four-phase and eight-beat pulse distribution mode is used to drive motor and the simple delay program is used to handle the time interval between the pulses to obtain different rotational speed. There are two output states for the step motor. One: when the temperature is over the upper value, the motor rotates reversely (to low the temperature), while when lower than the lower limit value, the motor rotates normally (to raise the temperature); besides not equals the preset value. Two: when the temperature is at somewhere between the two endsand equals the preset value, the motor stops. These steps are used to achieve the temperature control. In addition, the motor speed can also be adjusted by relative buttons. As shown in Fig. 8, the code data is input through ports A11~A8 (be P2.3~P2.0) of the AT89C51 and inverted output by the inverter 74LS04. Finally it is amplified by the power amplifier 2803A to power the motor.3.2 SOFTWARE DESIGNAccording to the general design requirement and hardware circuit principle of the system, as well as the improvement of the program readability, transferability and the convenient debugging, the software design is modularized. The system flow mainly includes the following 8 steps: POST (Power-on self-test), system initiation, temperature detection, alarm handling, temperature control, clock chip DS18B20 operation, LCD and keyboard operation. The main program flow is shown in Fig. 9. Give a little analysis to the above 8 tasks, it is easy to find out that the last five tasks require the real time operation. But to the temperature detection it can be achieved with timer0 timing 1 second, that is to say temperature detection occurs per second. The system initiation includes global variable definition, RAM initiation, special function register initiation and peripheral equipment initiation. Global variable definition mainly finishes the interface definition of external interface chip connected to the AT89C51, and special definition of some memory units. RAM initiation mainly refers to RAM processing. For example when the system is electrified the time code will be stored in the internal unit address or the scintillation flag will be cleared. The special function register initiation includes loading the initial value of timer and opening the interrupt. For example, when the system is electrified the timer is initialized. Theperipheral equipment initiation refers to set the initial value of peripheral equipment. For example, when the system is electrified, the LCD should be initialized, the start-up display should be called, the temperature conversion command should be issued firstly and the clock chip DS18B20 should also be initialized. The alarm handling is mainly the lowering and the raising of temperature to make the temperature remain with the preset range. When the temperature is between the upper and the lower limit value, it goes to temperature control handling, that is to say the temperature need to be raised or lowered according to the preset value. By doing so make the condition temperature equal to the preset value and hence to reach the temperature target.4 CONCLUSIONThe temperature control system has the advantages of friendly human-computer interaction interface, simple hardware, low cost, high temperature control precision (error in the range of ±1 ℃), convenience and versatility, etc. It can be widely used in the occasions with -55℃to 125℃range, and there is a certain practical value.温度控制系统的设计摘要研究了基于AT89C51单片机温度控制系统的原理和功能,温度测量单元由单总线数字温度传感器DS18B20构成。
单片机-温度控制系统-外文翻译-外文文献-英文文献-中英翻译讲课讲稿
Design of the Temperature Control System Based on AT89C51ABSTRACTThe 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; temperature1 INTRODUCTIONTemperature 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 IntroductionThe 8-bit AT89C51 CHMOS microcontrollers are designed to handle high-speed calculations and fast input/output operations. MCS 51 microcontrollers are typicallyused 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 features4Kbytes 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 theRAM contents but freezes the oscil–lator disabling all other chip functions until the next hardware reset.1.3Pin DescriptionVCC 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 (MOVX@DPTR). 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, Port3 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 adivide-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 ModeIn 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 AlgorithmBefore 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 more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached. Data Polling: The AT89C51 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the writtendatum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.2.1Ready/Busy:The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY.Program Verify:If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.2.2 Chip Erase:The entire Flash array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.2.3 Reading the Signature Bytes:The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned areas follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programming2.4 Programming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. A microcomputer interface converts information between two forms. Outside the microcomputer the information handled by an electronic system exists as a physical signal, but within the program, it is represented numerically. The function of anyinterface can be broken down into a number of operations which modify the data in some way, so that the process of conversion between the external and internal forms is carried out in a number of steps. An analog-to-digital converter(ADC) is used to convert a continuously variable signal to a corresponding digital form which can take any one of a fixed number of possible binary values. If the output of the transducer does not vary continuously, no ADC is necessary. In this case the signal conditioning section must convert the incoming signal to a form which can be connected directly to the next part of the interface, the input/output section of the microcomputer itself. Output interfaces take a similar form, the obvious difference being that here the flow of information is in the opposite direction; it is passed from the program to the outside world. In this case the program may call an output subroutine which supervises the operation of the interface and performs the scaling numbers which may be needed for digital-to-analog converter(DAC). This subroutine passes information in turn to an output device which produces a corresponding electrical signal, which could be converted into analog form using a DAC. Finally the signal is conditioned(usually amplified) to a form suitable for operating an actuator. The signals used within microcomputer circuits are almost always too small to be connected directly to the outside world”and some kind of interface must be used to translate them to a more appropriate form. The design of section of interface circuits is one of the most important tasks facing the engineer wishing to apply microcomputers. We have seen that in microcomputers information is represented as discrete patterns of bits; this digital form is most useful when the microcomputer is to be connected to equipment which can only be switched on or off, where each bit might represent the state of a switch or actuator. To solve real-world problems, a microcontroller must have more than just a CPU, a program, and a data memory. In addition, it must contain hardware allowing the CPU to access information from the outside world. Once the CPU gathers information and processes the data, it must also be able to effect change on some portion of the outside world. These hardware devices, called peripherals, are the CPU’s window to the outside.The most basic form of peripheral available on microcontrollers is the general purpose I70 port. Each of the I/O pins can be used as either an input or an output. The function of each pin is determined by setting or clearing corresponding bits in a corresponding data direction register during the initialization stage of a program. Each output pin may be driven to either a logic one or a logic zero by using CPUinstructions to pin may be viewed (or read.) by the CPU using program instructions. Some type of serial unit is included on microcontrollers to allow the CPU to communicate bit-serially with external devices. Using a bit serial format instead of bit-parallel format requires fewer I/O pins to perform the communication function, which makes it less expensive, but slower. Serial transmissions are performed either synchronously or asynchronously.3 SYSTEM GENERAL DESIGNThe hardware block diagram of the TC is shown in Fig. 1. The system hardware includes the micro controller, temperature detection circuit, keyboard control circuit, clock circuit, Display, alarm, drive circuit and external RAM. Based on the AT89C51, the DS18B20 will transfer the temperature signal detected to digital signal. And the signal is sent to the micro controller for processing. At last the temperature value is showed on the LCD 12232F. These steps are used to achieve the temperature detection. Using the keyboard interface chip HD7279 to set the temperature value, using the micro controller to keep a certain temperature, and using the LCD to show the preset value for controlling the temperature. In addition, the clock chip DS1302 is used to show time and the external RAM 6264 is used to save the monitoring data. An alarm will be given by buzzer in time if the temperature exceeds the upper and lower limit value of the temperature.3.1 HARDWARE DESIGNA. Micro controllerThe AT89C51 is a low-power, high-performance CMOS 8-bit micro controller with 4K bytes of in-system programmable Flash memory. The device is manufactured using At mel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the At mel AT89C51 is a powerful micro controller which provides a highly-flexible and cost-effective solution to many embedded control applications. Minimum system of the micro controller is shown in Fig. 2. In order to save monitoring data, the 6264 is used as an external RAM. It is a static RAM chip, low-power with 8K bytes memory.B. Temperature Detection CircuitThe temperature sensor is the key part in the system. The Dallas DS18B20 is used, which supports the 1-Wire bus interface, and the ON-BOARD Patented is used internally. All the sensor parts and the converting circuit are integrated in integrated circuit like a transistor [1]. Its measure range is -55℃~125 ℃, and the precision between -10℃~85℃is ±0.5℃[2 ,3]. The temperature collected by the DS18B20 is transmitted in the 1-Wire bus way, and this highly raises the system anti-jamming and makes it fit in situ temperature measurement of the rugged environment [4]. There are two power supply ways for the DS18B20. The first is external power supply: the first pin of the DS18B20 is connected to the ground; the second pin serves as signal wire and the third is connected to the power. The second way is parasite power supply [5]. As the parasite power supply will lead to the complexity of the hardware circuit, the difficulty of the software control and the performance degradation of the chip, etc. But the DS18B20(s) can be connected to the I/O port of the micro controller in the external power supply way and it is more popular. Therefore the external power supply is used and the second pin is connected to the pin P1.3 of the AT89S51. Actually, if there are multipoint to be detected, the DS18B20(s) can be connected to the 1-Wire bus. But when the number is over 8, there is a concern to the driving and the more complex software design as well as the length of the 1-Wire bus. Normally it is no more than 50m. To achieve distant control, the system can be designed in to a wireless one to breakthe length limit of the 1-Wire bus [6].C. LCD CircuitThe LCD 12232F is used, which can be used to show characters, temperature value and time, and supply a friendly display interface. The 12232F is a LCD with 8192 128×32 pixels Chinese character database and 128 16×8 pixels ASCII character set graphics. It mainly consists of row drive/column drive and 128×32 full lattice LCD with the function of displaying graphics as well as 7.5×2 Chinese characters. It is in a parallel or serial mode to connect to external CPU [7]. In order to economize the hardware resource, the 12232F should be connected to the AT89S51 in serial mode with only 4 output ports used. The LCD grayscale can be changed by adjusting the variable resistor connected the pin Vlcd of the LCD. CLK is used to transmit serial communication clock. SID is used to transmit serial data. CS is used to enable control the LCD. L+ is used to control the LCD backlight power.D. Clock CircuitThe Dallas DS18B20 is used, which is a high performance, low-power and real-time clock chip with RAM. The DS18B20 serves in the system with calendar clock and is used to monitor the time. The time data is read and processed by the AT89C51 and then displayed by the LCD. Also the time can be adjusted by the keyboard. The DS18B20 crystal oscillator is set at 32768Hz, and the recommended compensation capacitance is 6pF. The oscillator frequency is lower, so it might be possible not to connect the capacitor, and this would not make a big difference to the time precision. The backup power supply can be connected to a 3.6V rechargeable battery.E. Keyboard Control CircuitThe keyboard interface in the system is driven by the HD7279A which has a +5V single power supply and which is connected to the keyboard and display without using any active-device. According to the basic requirements and functions of the system, only 6 buttons are needed. The system's functions are set by the AT89C51 receiving the entered data. In order to save the external resistor, the 1×6 keyboard is used, and the keyboard codes are defined as: 07H, 0FH, 17H, 1FH, 27H, 2FH. The order can be read out by reading the code instruction. HD7279A is connected to the AT89S51 in serial mode and only 4 ports are need. As shown in Fig. 6, DIG0~DIG5 and DP are respectively the column lines and row line ports of the six keys which achieve keyboard monitoring, decoding and key codes identification.F. Alarm CircuitIn order to simplify the circuit and convenient debugging, a 5V automatic buzzer is used in the alarm circuit [8]. And this make the software programming simplified. As shown in Fig. 7, it is controlled by the PNP transistor 9012 whose base is connected to the pin P2.5 of the AT89C51. When the temperature exceeds the upper and lower limit value, the P2.5 output low level which makes the transistor be on and then an alarm is given by the buzzer.G. Drive CircuitA step motor is used as the drive device to control the temperature. The four-phase and eight-beat pulse distribution mode is used to drive motor and the simple delay program is used to handle the time interval between the pulses to obtain different rotational speed. There are two output states for the step motor. One: when the temperature is over the upper value, the motor rotates reversely (to low the temperature), while when lower than the lower limit value, the motor rotates normally(to raise the temperature); besides not equals the preset value. Two: when the temperature is at somewhere between the two ends and equals the preset value, the motor stops. These steps are used to achieve the temperature control. In addition, the motor speed can also be adjusted by relative buttons. As shown in Fig. 8, the code data is input through ports A11~A8 (be P2.3~P2.0) of the AT89C51 and inverted output by the inverter 74LS04. Finally it is amplified by the power amplifier 2803A to power the motor.3.2 SOFTW ARE DESIGNAccording to the general design requirement and hardware circuit principle of the system, as well as the improvement of the program readability, transferability and the convenient debugging, the software design is modularized. The system flow mainly includes the following 8 steps: POST (Power-on self-test), system initiation, temperature detection, alarm handling, temperature control, clock chip DS18B20 operation, LCD and keyboard operation. The main program flow is shown in Fig. 9. Give a little analysis to the above 8 tasks, it is easy to find out that the last five tasks require the real time operation. But to the temperature detection it can be achieved with timer0 timing 1 second, that is to say temperature detection occurs per second. The system initiation includes global variable definition, RAM initiation, special function register initiation and peripheral equipment initiation. Global variable definition mainly finishes the interface definition of external interface chip connected to the AT89C51, and special definition of some memory units. RAM initiation mainly refers to RAM processing. For example when the system is electrified the time code will be stored in the internal unit address or the scintillation flag will be cleared. The special function register initiation includes loading the initial value of timer and opening the interrupt. For example, when the system is electrified the timer is initialized. The peripheral equipment initiation refers to set the initial value of peripheral equipment. For example, when the system is electrified, the LCD should be initialized, the start-up display should be called, the temperature conversion command should be issued firstly and the clock chip DS18B20 should also be initialized. The alarm handling is mainly the lowering and the raising of temperature to make the temperature remain with the preset range. When the temperature is between the upper and the lower limit value, it goes to temperature control handling, that is to say the temperature need to be raised or lowered according to the preset value. By doing so make the condition temperature equal to the preset value and hence to reach thetemperature target.4 CONCLUSIONThe temperature control system has the advantages of friendly human-computer interaction interface, simple hardware, low cost, high temperature control precision (error in the range of ±1 ℃), convenience and versatility, etc. It can be widely used in the occasions with -55℃to 125℃range, and there is a certain practical value.。
单片机温度控制系统中英文对照外文翻译文献
中英文资料对照外文翻译(文档含英文原文和中文翻译)原文:Single-chip microcomputer temperature control system DescriptionThe at89s52 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash Programmable and Erasable Read Only Memory (PEROM) and 128 bytes RAM. The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard MCS-51™ instruction set and pinout. The chip combines a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel at89s52 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.Features:• Compatible with MCS-51™ Products• 4K Bytes of In-System Reprogrammable Flash Memory• Endurance: 1,000 Write/Erase Cycles• Fully Static Operation: 0 Hz to 24 MHz• Three-Level Program Memory Lock• 128 x 8-Bit Internal RAM• 32 Programmable I/O Lines• Two 16-Bit Timer/Counters• Six Interrupt Sources• Programmable Serial Channel• L ow Power Idle and Power Down ModesThe at89s52 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the at89s52 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 system 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.Pin Description:VCC Supply voltage.GND Ground.Port 0Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can sink eight TTL inputs. When is 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 loworder address/data bus during accesses to external program and data memory. In this mode P0 has internal pullups.Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pullups are required during program verification.Port 1Port 1 is an 8-bit bidirectional I/O port with internal pullups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pullups 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 2Port 2 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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 pullups.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 (MOVX @ DPTR). 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 during Flash programming and verification.Port 3Port 3 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups.Port 3 also serves the functions of various special features of the at89s52 as listed below:Port pin alternate functionsP3.0 rxd (serial input port)P3.1 txd (serial output port)P3.2 ^int0 (external interrupt0)Port 3 also receivessome control signals forFlash programming andverification. RSTReset input. A high on this pin for two machine cycles while the oscillator is runningresets the device.ALE/PROGAddress Latch Enable output pulse for latching the low byte of the address duringaccesses 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 during 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.PSENProgram Store Enable is the read strobe to external program memory.When the at89s52 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/VPPExternal 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 also receives the 12-volt programming enable voltage(VPP) during Flashprogramming, for parts that require 12-volt VPP.XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2Output from the inverting oscillator amplifier.Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifierwhich 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. P3.3 ^int1 (external interrupt1) P3.4 t0 (timer0 external input) P3.5 t1 (timer1 external input) P3.6 ^WR (external data memory write strobe) P3.7^rd (external data memory read strobe)Idle ModeIn idle mode, the CPU puts itself to sleep while all the onchip 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.Status of External Pins During Idle and Power Down Modesmode Program memory ALE ^psen Port0 Port1Port2Port3idle internal 1 1 data data data DataIdle External 1 1 float Data data Data Power down Internal 0 0 Data Data Data Data Power down External 0 0 float data Data data Power Down ModeIn 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.Program Memory Lock BitsOn the chip are three lock bits which can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in the table below:Lock Bit Protection ModesWhen lock bit 1 is programmed, the logic level at the EA pin is sampled and latchedduring reset. If the device is powered up without a reset, the latch initializes to a random value, and holds that value until reset is activated. It is necessary that the latched value of EA be in agreement with the current logic level at that pin in order for the device to function properly. Programming the Flash:The at89s52 is normally shipped with the on-chip Flash memory array in the erased state (that is, contents = FFH) and ready to be programmed.The programming interface accepts either a high-voltage (12-volt) or a low-voltage (VCC) program enable signal.The low voltage programming mode provides a convenient way to program the at89s52 inside the user’s system, while th e high-voltage programming mode is compatible with conventional third party Flash or EPROM programmers.The at89s52 is shipped with either the high-voltage or low-voltage programming mode enabled. The respective top-side marking and device signature codes are listed in the following table.Vpp=12v Vpp=5vTop-side mark at89s52xxxxyywwat89s52xxxx-5yywwsignature (030H)=1EH(031H)=51H(032H)=FFH (030H)=1EH (031H)=51H (032H)=05HThe at89s52 code memory array is programmed byte-bybyte in either programming mode. To program any nonblank byte in the on-chip Flash Programmable and Erasable Read Only Memory, the entire memory must be erased using the Chip Erase Mode. Programming Algorithm:Before programming the at89s52, the address, data and control signals should be set up according to the Flash programming mode table and Figures 3 and 4. To program the at89s52, 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. Thebyte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached.Data Polling: The at89s52 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.Ready/Busy: The progress of byte programming can also be monitored by theRDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY.Program Verify: If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.Chip Erase: T he entire Flash Programmable and Erasable Read Only Memory array is erased electrically by using the proper combination of control signals and by holdingALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.Reading the Signature Bytes: The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned are as follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programmingProgramming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is selftimed and once initiated, will automatically time itself to completion.译文:单片机温度控制系统描述at89s52是美国ATMEL公司生产的低电压,高性能CMOS8位单片机,片内含4Kbytes 的快速可擦写的只读程序存储器(PEROM)和128 bytes 的随机存取数据存储器(RAM),器件采用ATMEL公司的高密度、非易失性存储技术生产,兼容标准MCS-51产品指令系统,片内置通用8位中央处理器(CPU)和flish存储单元,功能强大at89s52单片机可为您提供许多高性价比的应用场合,可灵活应用于各种控制领域。
基于单片机的多点温度检测系统的设计外文翻译
基于单片机的多点温度检测系统的设计外文翻译中文5765字基于单片机的多点温度检测系统的设计一、开场白随着社会的发展和技术的进步,人们越来越注重温度检测与显示的重要性。
温度检测与状态显示技术与设备已经普遍应用于各行各业,市场上的产品层出不穷。
温度检测及显示也逐渐采用自动化控制技术来实现监控。
本课题就是一个温度检测及状态显示的监控系统。
二、系统方案本系统采用at89c51作为该系统的单片机。
系统整体硬件电路包括,电源电路,传感器电路,温度显示电路,上下限报警电路等。
报警电路可以在被测温度不在上下限范围内时,发出报警鸣叫声音。
温度控制的基本原理为:当dsl8b20采集到温度信号后,将温度信号送至at89c51中处理,同时将温度送到lcd液晶屏显示,单片机根据初始化设复置的温度上上限展开推论处置,即为如果温度大于短果的最低温度就启动风扇降温;如果温度大于所预设的最低温度就启动报警装置。
温度控制器的原理图三、系统硬件设计1.单片机at89c51的了解与mcs-51产品指令系统完全兼容4k字节可重擦写flash闪速存储器1000次擦写周期1全静态操作:0hz―24mhz三级加密程序存储器128×8字节内部ram32个可编程i/o口线2个16位定时/计数器6个中断源可编程以太网uart地下通道低功耗空闲和高速缓存模式功能特性详述:at89c51提供以下标准功能:4k字节flash闪速存储器,128字节内部ram,32个i/o口线,两个16十一位定时/计数器,一个5向量两级中断结构,一个全双工以太网通信口,片内振荡器及时钟电路。
同时,at89c51可以降到0hz的静态逻辑操作方式,并积极支持两种软件附加的节电工作模式。
空闲方式暂停cpu的工作,但容许ram,定时/计数器。
以太网通信口及中断系统稳步工作。
高速缓存方式留存ram中的内容,但振荡器暂停工作并严禁其它所有部件工作直至下一个硬件登位。
插槽功能表明:vcc:电源电压gnd:地p0口:p0口就是一组8位漏极开路型双向i/o口,也即为地址/数据总线F83E43Se 口。
基于单片机控制温湿度的系统外文及翻译
New Environment Parameters Monitoring And Control System For Greenhouse Based OnMaster-slave DistributedAbstract--According to the actual need of monitoring and control of greenhouse environment parameters in rural areas,a master-slave distributed measurement and control system is designed,in which PC is taken as the host. The system consists of PC ,soil moisture measurement and control module,temperature and humidity, and CO2 monitoring and control module. In the system,PC has large amount of data storage which is easy to make use of fuzzy control expert system,configuration software-KingView is used to develop software for PC,by which the development cycle is shorten and a friendly human-computer interaction is provided.Each monitoring and control module consists of STC12 series of microcontrollers,sensors,relays etc.Different modules are select based on the need if system to achieve control greenhouse in partition and block.I. INTRODUCTIONTo modern indoor agriculture, the automatic measurement and control of environment parameters is the key to achieve crop yield and quality of greenhouse.In recent years,facilities agriculture develops vigorously in our country,matched with it,the monitoring and control instrument of greenhouse have also made certain development.After nearly 10 years of unremitting hard work,our research team of measurement and control system of agriculture environment parameters,designed an intelligent measurement and control system of distribution combined of greenhouse which can be popularized in the vast rural areas.This system is mainly control of temperature,humidity,CO2 concentration,soil moisture and illumination of greenhouse.OF SCM,as the data storage is small,display interface is single,amount of information is limited,but its capability price ratio is high,so it is used as a front unit of data acquisition and control;and of PC,it has a large amount of data storage,rich software,convenient human-computer interaction,and so on.If we use outdated and low-priced PC,taking the PC as the upper machine,taking the different function control modules composed of multiple microcomputers as the lower machines,then a master-slave distributed and intelligent control system bases on microcomputer is made up,by which both better monitoring and control,display and data collection or management are achieved,but also lower cost of system is get according to the actual need.II SYSTEM STRUCTURE AND PRINCIPLEThe most marked feature of the distribution combined and intelligent control system greenhouse is that of incorporating with data acquisition, control and management as a whole,module combination, simple structure,convenient human-computer interaction,and using technology of intelligent expert fuzzy control,which can adapt to a variety of crop management control in greenhouse.The basic structure of the system is shown in Fig.1.The structure of the distributed system is composed of two layers:the upper and lower.In the top-price PC is taken as the host to make system management and experts fuzzy operation in intelligent,and to provide a friendly human-computer interface,and to realize the united monitoring and management of greenhouse; the lower is composed of a series of modules of different function,and in each module,a single chip of AT89C is adopted as the lower machine,RS485 is used to communicate PC with all AT89C,and then the collection,processing and control of the greenhouse parameters is achieved.Each function module is completely isolated in electrical,any failure on the nodule does not produce any effect on other modules.The systemcollects separately ways of environment information through each monitoring and control module,and sends it to host PC through the RS485 interface.And in the PC configuration control system,the acquired parameters are compared with the values of setting,then according to a variety of expert intelligent fuzzy control system of crops at different growth stages,the fuzzy control instructions on the environment temperature,humidity,CO2 concentration,soil water content and the corresponding operation instructions or alarm are given.The system is applied in rural greenhouses in ually at 1/4 near East and West end in a greenhouse,and at the height of 1.5m from the ground in the middle in the northern half (near the wet curtain) and the southern half (near the fan ),a module of air temperature and humidity ,CO2 concentration and a module of soil moisture content are set;a module of soil moisture content will be added in the middle of the greenhouse according to the actual condition;at the height of 1.5m in the main entrance,a water tank is set,of which the solenoid of drip tube should be set based on the need and controlled by module of soil moisture content;and the PC is placed in the main entrance to the greenhouse.III . HARDW ARE DESIGNA.The CP and communication systemIn the distributed system of data acquisition and control,as the micro control unit is limited in data storage and slow in calculating of complex functions,so PC is used and the master-slave module is adopted in the system,that is a system of,taking PC as the host and taking the SCM systems located in the scene as slave.In this distributed system,communication is the key to it.Generally,the serial port of PC is standard RS232,of which transmission distance is shorter.But in agriculture control system.its communication distance is of tens of meters or several kilometers, so RS232/RS485 converter is used to achieve communication between the PC and SCM.To reduce investment,both considering the user convenience and friendly human-computer interaction,low-price PC of above 486 and below PIV is adopted;and considering the operation of configuration software,it is required that memory is 64M or above and hard disk is 10Gb or above.B. The control modules of temperature and humidity,illuminance and CO2 concentrationEach control unit consists of SCM,sensors,signal processing circuit,RS485 interface and output circuit.The hardware structure of module of temperature and humidity,CO2 concentration is shown in Fig.2.CO2 concentration is measured by sensor based on NDIR technology,measurement is of 0~2×103mol.Through the sensor,control system,by software of digital filter,linear interpolation and temperature compensation,the CO2 concentration is output as digital adhered to UART protocol,and then is input directly to the SCM.The new intelligent sensor of SHT11 based on CMOSens technology is chosen in the measurement of temperature and humidity.In SHT11,the temperature and humidity sensors,signal amplification,A/D,I2C bus are all integrated in a chip;it has full-scale calibration,second-line digital output,and humidity measuring range of 0~100% RH,temperature measurement range of -40℃~+123.8℃,humidity measurement accuracy of ±3.0% RH,temperature measurement accuracy of ±0.4℃,the response time of <4s.The illuminance sensor of JY1-TBQ-6 of silicon photovoltaic detection is used Light measuring.Its measurement range is 0~200,000 Lux;spectral range is 400~700(nm) visible light;measurement error is less than 2%; output is 4~20mA or 0~20mV;output signal can bedirectly send to the A/D of the SCM after being amplified to 0~4V.Modules accept the instructions form the the Upper,and output via the output circuit .The output circuit consists of optical isolation,the signal driver and the output relays.C. The measurement and control modules of soil moistureWater is a polar medium, the dielectric constant of the soil containing water is mainly determined by the water,when water content is different,the wave impedance is different.The soil moisture is measured by standing wave radio method in this system.Based on the theory of Engineering Electromagnetic Field,for lossy medium,the electromagnetic wave impedance as follows:Z0=√μ/ε(1+jλ/(ωε))Where μis medium permeability,and μof soil is μ≈μ0 is the vacuum permeability;εis medium dielectric constant;λis medium conductivity;ωis electromagnetic wave frequency.In the very low audio(<2000Hz),the loss tangent of dry soil dielectric is λ/ωε≈0.07,if you choose the frequency of the signal source at above 20MHz.then,ε≈ε∞,the imaginary part of the soil wave impedance is neglect,only the real part,which amounts to a pure resistance.Soil moisture sensor consists of 100MHz signal source,a coaxial transmission line and a 4-pin stainless probe.The electromagnetic waves of signal transmit to the probe along the lines.As the probe impedance and line impedance are different,the superimposition of incident waves and reflected waves forms a standing waves.Taking the coaxial transmission line as a lossless uniform line,wave impedance is Z0,Z l is the load impedance.Then the reflected coefficient of voltage wave at the probe is:Γ=(Z L-Z0)/(Z L+Z0)Choosing the length of transmission line is l=λ/4,the maximum and minimum of both ends of the line are U max and U min,Then the standing wave radio in the line can be expressed as: S=U max /U min =(1-|Γ|)/(1+|Γ|)In the way,the soil moisture radio can be measured by measuring the standing wave rate of transmission line.As shown in Fig.3.,soil moisture module consists of sensors and controllers,the sensors are subordinated to controllers,controllers can be omitted without the need of irrigation in greenhouse.To simplify the control,irrigation technology of node-type in partition is adopted in the control soil moisture in this system.To a certain extent,the parameters of upper and lower the ground can be decoupled by adopting this technology.IV CONTROL SYSTEM PROGRAMMINGThe software of PC is developed by KingView 6.51 of Beijing-controlled Asia.This configuration software has high reliability,shorter development cycle,perfect capability of graphical interface generation,and friendly human-computer interaction;and can create dynamic images and charts in accordance with the layout of equipment in the scene;can visually display the changes of parameters,control status,and can give an alarm when over-limited;and can achieve fuzzy control of greenhouse parameters by using the history curve of environment parameters stored in the specific database and adopting the agricultural expert system.The software of SCM of the slave is developed by Keil C51 to achieve real-time collecting,processing,uploading of the parameters and accept the fuzzy control instructions from the host computer and complete local control of the device.A.Program design of the control moduleThe software of the sub-slave machine of soil moisture module,that include the main function,subroutines of data acquisition and processing,interrupt handling and communicating etc,read the value of standing wave voltage through the parallel data port and obtained the value of soil moisture content by function calculating.The software of the slave machine of monitoring and control of soil moisture mainly complete data communication with the sub-slave machine,uploading measurement data and current control state to the host computer,accepting the fuzzy control instructions from the host computer and output the implementation instructions.The software of the slave machine of temperature and humidity,and CO2 mainly complete reading data of CO2 concentrations and temperature and humidity through the I2C concentration,uploading measurement data and current control state to the host computer,accepting the fuzzy control instructions from the host computer and output the implementation instructions.The structure of the main program and interrupt subroutine of temperature and humidity module are shown in Fig.4.The serial interrupt mode 3 is adopted by all slaves to communicate with the host,transmit the digital collecting and receive instructions.B. Program design of PC and fuzzy control system1)The communication settings of KingView 6.51:In order to ensure the correctness of communication,the upper and lower must follow the same communication protocol,set the communication ually in communication,master-slave mode is adopted in style and responder is adopted in the process.That is ,the master sent a command to the slave first,then et slave give an answer after receiving the command,thus once communication is completed.In KingView ,a scheduled polling method is adopted to do reading and writing between the lower machine by PC.In the project browser of KingView,first,click device →COM1;in the wizard of device configuration,select intelligent modules→SCM→current SCM of HEX→serial port,and then ser parameters for the host computer’s communication.2)The connection of KingView 6.51 and database:Database is the core of the software,that not only contains the definition of variables,real-time parameters and the historical parameters,but also is needed by parameters alarming,fuzzy calculating,reporting ,and displaying.Access2003 desktop database is used as records database of the system,and by using SQL,it is operated by KingView via ODBC.The procedure is :to create data variables in KingView to create a body of records to establish a data source of ODBC to create query screens and make the screen connection.To connected with Microsoft Access2003,the functions of SQLConnect(),SQLSelect(),SQLLast(),SQLNext(),SQLFist(),SQLPrew(),SQLInsrt(),and so on,should be implemented in the command language,and then real-time storage and inquiry of data are completed.3)Software design of PC :For the control system of greenhouse,data storage capacity of the PC is unlimited,so if the existing mature software modules are include into the system,it both be relaxed and can improve the system reliability.The software of software consists of control module and management module.Software of the system consists of the main control interface,auxiliary,databases,etc.A typical main interface of monitoring and control of PC is shown in Fig.5.V. CONCLUSIONAccording to the economic bearing capacity of farmer in Qinhuangdao ,with the existing technology of monitoring and control of environment parameters of greenhouse,a master-slave distributed automatic control system of greenhouse environment in which PC is taken as the host computer is developed.The system has following characteristics:1)With the large amount of data storage of PC,fuzzy control expert system is easy of data storage,modification and system upgrading.2)By using KingView to develop software of PC,the system reliability is improved,and the development cycle is shorten,and a friendly human-computer interface is get.3)A distributed and modular structure is used in the system,it makes the system maintenance easier and adapts to production needs more. The monitoring and control modules of the slave are connected to the host through the RS485 bus based on needs,then the control of greenhouse in partition or block can be achieved.ACKNOWLEDGMENTThis work is supported by Agricultural Science and Technology Achievement Transformation Fund Project.基于主从分布式新的温室环境参数监测和控制系统根据实际在农村地区的温室环境参数的监测和控制,主从分布式测量和控制系统的设计需要,以其中一台计算机作为主机,该系统由PC、土壤水分测量和监测和控制模块组成。
基于单片机多回路温度采集系统的设计
基于单片机多回路温度采集系统的设计【摘要】多路温度采集系统由主控制器、温度采集电路、温度显示电路及键盘输入控制电路组成。
它利用单片机AT89C52做控制及数据处理器、智能温度传感器DS18B20做温度检测器、LCD显示管做温度显示输出设备。
硬件电路成本较低,测温范围大,测量精度高,读数显示直观,使用方便。
【关键词】温度;传感器;单片机;控制Abstract:the multi-channel temperature gathering system by the master control regulator,the temperature gathering electric circuit,the temperature display circuit,and the keyboard entry control circuit is composed.It makes the control and the data processor,intelligent temperature sensor DS18B20 using monolithic integrated circuit AT89C52 makes the temperature detector,the LCD display tube makes the temperature demonstration output unit.The hardware electric circuit quite is simple,the cost is low,the temperature measurement scope is big,and the measuring accuracy is high,reading demonstration is direct-viewing,easy to operate.Key words:temperature;sensor;monolithic integrated circuit;control一、主控部分采用AT89S52八位单片机实现。
单片机温度控制系统中英文外文翻译文献
中英文资料外文翻译文献英文原文DescriptionThe at89s52 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash Programmable and Erasable Read Only Memory (PEROM) and 128 bytes RAM. The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard MCS-51™ instruction set and pinout. The chip combines a versatile 8-bit CPU with Flash on a monolithic chip, the Atmelat89s52 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.Features:• Compatible with MCS-51™ Products• 4K Bytes of In-System Reprogrammable Flash Memory• Endurance: 1,000 Write/Erase Cycles• Fully Static Operation: 0 Hz to 24 MHz• Th ree-Level Program Memory Lock• 128 x 8-Bit Internal RAM• 32 Programmable I/O Lines• Two 16-Bit Timer/Counters• Six Interrupt Sources• Programmable Serial Channel• Low Power Idle and Power Down ModesThe at89s52 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vectortwo-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the at89s52 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 system 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.Pin Description:VCC Supply voltage.GND Ground.Port 0Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can sink eight TTL inputs. When is 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 loworderaddress/data bus during accesses to external program and data memory. In this mode P0 has internal pullups.Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pullups are required during program verification.Port 1Port 1 is an 8-bit bidirectional I/O port with internal pullups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pullups 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 2Port 2 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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 pullups.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 (MOVX @ DPTR). In this application it uses strong internalpull-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 during Flash programming and verification.Port 3Port 3 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups.Port 3 also serves the functions of various special features of theat89s52 as listed below:Port 3 also receives some control signals for Flash programming andverification.RSTReset input. A high on this pin for two machine cycles while theoscillator is running resets the device.ALE/PROGAddress Latch Enable output pulse for latching the low byte of theaddress 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 theoscillator frequency, and may be used for external timing or clockingpurposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory.If desired, ALE operation can be disabled by setting bit 0 of SFRlocation 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.PSENProgram Store Enable is the read strobe to external program memory. When the at89s52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSENactivations are skipped during each access to external data memory.EA/VPPExternal 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. Port pinalternate functions P3.0rxd (serial input port) P3.1txd (serial output port) P3.2^int0 (external interrupt0) P3.3^int1 (external interrupt1) P3.4t0 (timer0 external input) P3.5t1 (timer1 external input) P3.6^WR (external data memory write strobe) P3.7 ^rd (external data memory read strobe)EA should be strapped to VCC for internal program executions.This pin also receives the 12-volt programming enable voltage(VPP) during Flash programming, for parts that require 12-volt VPP.XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit.XTAL2Output 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 ModeIn idle mode, the CPU puts itself to sleep while all the onchip 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.Status of External Pins During Idle and Power Down Modesmode Program memory ALE ^psen Port0 Port1Port2Port3idle internal 1 1 data data data Data Idle External 1 1 float Data data Data Power down Internal 0 0 Data Data Data Data Power down External 0 0 float data Data data Power Down ModeIn the power down mode the oscillator is stopped, and the instructionthat invokes power down is the last instruction executed. The on-chip RAMand Special Function Registers retain their values until the power down modeis terminated. The only exit from power down is a hardware reset. Resetredefines the SFRs but does not change the on-chip RAM. The reset shouldnot be activated before VCC is restored to its normal operating level andmust be held active long enough to allow the oscillator to restart andstabilize.Program Memory Lock BitsOn the chip are three lock bits which can be left unprogrammed (U) orcan be programmed (P) to obtain the additional features listed in the tablebelow:Lock Bit Protection ModesWhen lock bit 1 is programmed, the logic level at the EA pin issampled and latched during reset. If the device is powered up without a reset,the latch initializes to a random value, and holds that value until reset isactivated. It is necessary that the latched value of EA be in agreement with the current logic level at that pin in order for the device to function properly. Programming the Flash:The at89s52 is normally shipped with the on-chip Flash memory array in the erased state (that is, contents = FFH) and ready to be programmed.The programming interface accepts either a high-voltage (12-volt) or alow-voltage (VCC) program enable signal.The low voltage programming mode provides a convenient way to program the at89s52 inside the user’s system, while the high-voltage programming mode is compatible with conventional third party Flash or EPROM programmers.The at89s52 is shipped with either the high-voltage or low-voltage programming mode enabled. The respective top-side marking and device signature codes are listed in the following table.Vpp=12v Vpp=5vTop-side mark at89s52xxxxyywwat89s52xxxx-5yywwsignature (030H)=1EH(031H)=51H(032H)=FFH (030H)=1EH (031H)=51H (032H)=05HThe at89s52 code memory array is programmed byte-bybyte in either programming mode. To program any nonblank byte in the on-chip Flash Programmable and Erasable Read Only Memory, the entire memory must be erased using the Chip Erase Mode.Programming Algorithm:Before programming the at89s52, the address, data and control signals should be set up according to the Flash programming mode table and Figures 3 and 4. To program the at89s52, 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 more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached.Data Polling: The at89s52 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.Ready/Busy: The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY.Program Verify: If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.Chip Erase: T he entire Flash Programmable and Erasable Read Only Memory array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.Reading the Signature Bytes: The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned are as follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programmingProgramming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is selftimed and once initiated, will automatically time itself to completion.中文翻译描述at89s52是美国ATMEL公司生产的低电压,高性能CMOS8位单片机,片内含4Kbytes的快速可擦写的只读程序存储器(PEROM)和128 bytes 的随机存取数据存储器(RAM),器件采用ATMEL公司的高密度、非易失性存储技术生产,兼容标准MCS-51产品指令系统,片内置通用8位中央处理器(CPU)和flish存储单元,功能强大at89s52单片机可为您提供许多高性价比的应用场合,可灵活应用于各种控制领域。
毕业设计(论文)单片机温度数据采集系统
单片机温度采集系统摘要本文设计是以AT89C51单片机系统为基础的,通过热电阻变送器对热电阻随温度的变化而得到的模拟信号进行采集,连接多路模拟开关实现多路模拟信号的采集,并通过A/D转换器对模拟信号进行数模转换,把转换得到的数字信号按照顺序分别送入单片机或把指定的那路信号送入单片机,通过单片机进行控制操作。
本文通过单片机报警系统来实现热电阻传感器测量的温度范围200-700摄氏度,若超出这个温度范围则报警。
以单片机为核心完成温度检测、数据处理.显示及上下限报警功能。
关键词:数据采集系统,单片机,A/D转换器,热电阻变送器The Temperature Acquisition SystemABSTRACTIt is based on AT89C51 one-chip computer system for this text to design, is it gather to go on through thermal resistance changer to analog signal that thermal resistance receive with change of temperature, join many way analog switch realize many way collection of analog signal , is it count through A/D converter to analog signal mould change to go on, Send digital signal received to change according to order into one-chip computer or designated those distance signal send into the one-chip computer separately, carry on control operation through one-chip computer. This text realizes 200~700 degrees Centigrade of temperature ranges that the thermal resistance sensor measure at the same time through the warning system of the one-chip computer, if beyond the scope of this temperature to report to the police. Regard one-chip computer as the core and finish temperature and patrol examining , data processing. Show and the warning function of upper and lower limits.KEY WORDS: DCS,One-Chip Computer,A/D converter,Thermal Resistance Changer目录前言 (1)第1章绪论 (2)1.1课题背景 (2)1.2温度采集的意义和技术发展 (2)1.3单片机在本课题中的应用 (3)第2章主控模块的设计 (5)2.1 8051单片机的引脚功能 (5)2.2 8051单片机的扩展及系统电路 (7)第3章信号输入通道与信号采样模块的设计 (10)3.1 A/D芯片的选用及说明 (10)3.1.1逐渐逼近式A/D转换器的工作原理 (10)3.1.2 A/D转换器的性能指标 (11)3.1.3 典型的A/D转换芯片ADC0809 (12)3.2信号采样模块的电路设计 (14)第4章显示系统、报警系统及键盘控制 (16)4.1 显示系统的设计 (16)4.1.1 LED显示器件的工作原理 (16)4.1.2 LED显示电路设计 (18)4.2报警系统的设计 (19)4.3 键盘控制的设计 (19)4.4 系统的电源设计 (20)第5章系统软件设计 (22)5.1 主控模块的系统设计 (22)5.2 LED显示程序设计 (25)5.3 报警系统的程序设计 (26)结论 (28)谢辞 (29)参考文献 (30)附录一 (31)附录二 (36)外文资料译文 (37)前言温度是一个非常重要的物理量,因为它直接影响燃烧、化学反应、烘烤、煅烧、蒸馏、结晶、空气流动以及温度漂移等物理和化学过程。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
DALLAS 最新单线数字温度传感器 DS18B20 简介新的"一线器件"体积更小、适用电压 更宽、更经济 Dallas 半导体公司的数字化温度传感器 DS1820 是世界上第一片支持 "一 线总线"接口的温度传感器。一线总线独特而且经济的特点,使用户可轻松地组建传感器 网络,为测量系统的构建引入全新概念。DS18B20 "一线总线"数字化温度传感器同 DS1820 一样,DS18B20 也支持"一线总线"接口,测量温度范围为-55°C~+125°C,在-10~+85°C 范围内,精度为±0.5°C。现场温度直接以"一线总线"的数字方式传输,大大提高了系统 的抗干扰性。
·两个 16 位定时器/计数器 ·5 个中断源 ·可编程串行通道 ·低功耗的闲置和掉电模式 ·片内振荡器和时钟电路
管脚说明:
VCC:供电电压。 GND:接地。 P0 口:P0 口为一个 8 位漏级开路双向 I/O 口,每脚可吸收 8TTL 门电流。当 P0 口的 管脚第一次写 1 时,被定义为高阻输入。P0 能够用于外部程序数据存储器,它可以被定 义为数据/地址的第八位。在 FIASH 编程时,P0 口作为原码输入口,当 FIASH 进行校验 时,P0 输出原码,此时 P0 外部必须被拉高。 P1 口:P1 口是一个内部提供上拉电阻的 8 位双向 I/O 口,P1 口缓冲器能接收输出 4TTL 门电流。P1 口管脚写入 1 后,被内部上拉为高,可用作输入,P1 口被外部下拉为低 电平时,将输出电流,这是由于内部上拉的缘故。在 FLASH 编程和校验时,P1 口作为第 八位地址接收。 P2 口:P2 口为一个内部上拉电阻的 8 位双向 I/O 口,P2 口缓冲器可接收,输出 4 个 TTL 门电流,当 P2 口被写“1”时,其管脚被内部上拉电阻拉高,且作为输入。并因 此作为输入时,P2 口的管脚被外部拉低,将输出电流。这是由于内部上拉的缘故。P2 口 当用于外部程序存储器或 16 位地址外部数据存储器进行存取时,P2 口输出地址的高八 位。在给出地址“1”时,它利用内部上拉优势,当对外部八位地址数据存储器进行读写 时,P2 口输出其特殊功能寄存器的内容。P2 口在 FLASH 编程和校验时接收高八位地址信 号和控制信号。 P3 口:P3 口管脚是 8 个带内部上拉电阻的双向 I/O 口,可接收输出 4 个 TTL 门电流。 当 P3 口写入“1”后,它们被内部上拉为高电平,并用作输入。作为输入,由于外部下 拉为低电平,P3 口将输出电流(ILL)这是由于上拉的缘故。 RST:复位输入。当振荡器复位器件时,要保持 RST 脚两个机器周期的高电平时间。 ALE/PROG:当访问外部存储器时,地址锁存允许的输出电平用于锁存地址的地位字
毕业论文(设计) 外文翻译
题 目: 基于单片机的多路温度采集系统设计
系部名称: 学生姓名: 指导教师:
专业班级: 学 日
中原工学院信息商务学院外文翻译
多路温度传感器
一 温度传感器简介
1.1 温度传感器的背景 在人类的生活环境中,温度扮演着极其重要的角色。无论你生活在哪里,从事什么 工作,无时无刻不在与温度打着交道。自 18 世纪工业革命以来,工业发 展对是否能掌 握温度有着绝对的联系。在冶金、钢铁、石化、水泥、玻璃、医药 等等行业,可以说几 乎%80 的工业部门都不得不考虑着温度的因素。 温度对于工业如此重要,由此推进了温 度传感器的发展。 1.2 温度传感器的发展 传感器主要大体经过了三个发展阶段:模拟集成温度传感器。该传感器是采用硅半 导体集成工艺制成,因此亦称硅传感器或单片集成温度传感器。此种传感器具有功能单 一(仅测量温度)、测温误差小、价格低、响应速度快、传输距离远、体积小、微功耗等, 适合远距离测温、控温,不需要进行非线性校准,外围电路简单。它是目前在国内外应 用最为普遍的一种集成传感器,典型产品有 AD590、AD592、TMP17、LM135 等;模拟集成 温度控制器。模拟集成温度控制器主要包括温控开关、可编程温度控制器,典型产品有 LM56、AD22105 和 MAX6509。某些增强型集成温度控制器(例如 TC652/653)中还包含了 A/D 转换器以及固化好的程序,这与智能温度传感器有某些相似之处。但它自成系统, 工作时并不受微处理器的控制,这是二者的主要区别;智能温度传感器。能温度传感器(亦 称数字温 度传感器)是在 20 世纪 90 年代中期问世的。它是微电子技术、计算机技术和 自动测试技术(ATE)的结晶。智能温度传感器内部都包含温度传感器、A/D 转换器、 信 号处理器、存储器(或寄存器)和接口电路。有的产品还带多路选择器、中央控制器(CPU)、 随机存取存储器(RAM)和只读存储器(ROM)。智能温度传感器的特点是能输出温度数据及 相关的温度控制量,适配各种微控制器(MCU);并且它是在硬件的基础上通过软件来实现 测试功能的,其智能化程度也取决于软件的开发水平。 温度传感器的发展趋势。 进入 21 世纪后,温度传感器正朝着高精度、多功能、总线标准化、高可靠性及安全性、开发 虚拟传感器和网络传感器、研制单片测温系统等高科技的方向迅速发展。
(4) 12 位分辨率时最多在 750ms 内把温度值转换为数字; (5) 负压特性:电源极性接反时,温度计不会因发热而烧毁,但不能正常工作。 DS1820 的外形 DS18B20 内部结构主要由四部分组成:64 位光刻 ROM、温度传感器、非挥发的温度报警触 发器 TH 和 TL、配置寄存器。DS18B20 的管脚排列如“图 1-3”所示。内部结构如“图 1-4” 所示
适合于恶劣环境的现场温度测量,如:环境控制、设备或过程控制、测温类消费电 子产品等。与前一代产品不同,新的产品支持 3V~5.5V 的电压范围,使系统设计更灵活、 方便。而且新一代产品更便宜,体积更小。DS18B20 可以程序设定 9~12 位的分辨率,精 度为±0.5°C。可选更小的封装方式,更宽的电压适用范围。分辨率设定,及用户设定 的报警温度存储在 EEPROM 中,掉电后依然保存。DS18B20 的性能是新一代产品中最好的! 性能价格比也非常出色!
图 1-2 AT89C51 引脚图
主要特性:
·与 MCS-51 兼容 ·4K 字节可编程 FLASH 存储器 ·寿命:1000 写/擦循环 ·数据保留时间:10 年 ·全静态工作:0Hz-24MHz ·三级程序存储器锁定 ·128×8 位内部 RAM ·32 可编程 I/O 线
4
中原工学院信息商务学院外文翻译
二 系统的实现及相关技术
2.1.系统的实现
系统的实现采用多线连接,就是四个 DS1820 分别连接到单片机的四个 IO 口,这种 方案虽然占用单片机的四个 IO 口,但在单片机 IO 口不紧缺的情况下采用这种方案大大 的简化了编程难度,缩短了设计周期,同时也能保证系统的稳定。方案二的框图如“图 1-1”所示
DS1820 的新性能: (1) 可用数据线供电,电压范围:3.0~5.5V; (2) 测温范围:-55~+125℃,在-10~+85℃时精度为±0.5℃;
6
中原工学院信息商务学院外文翻译
(3) 可编程的分辨率为 9~12 位,对应的可分辨温度分别为 0.5℃、0.25℃、0.125℃ 和 0.0625℃;
5
中原工学院信息商务学院外文翻译
节。在 FLASH 编程期间,此引脚用于输入编程脉冲。在平时,ALE 端以不变的频率周期输 出正脉冲信号,此频率为振荡器频率的 1/6。因此它可用作对外部输出的脉冲或用于定时 目的。然而要注意的是:每当用作外部数据存储器时,将跳过一个 ALE 脉冲。如想禁止 ALE 的输出可在 SFR8EH 地址上置 0。此时, ALE 只有在执行 MOVX,MOVC 指令是 ALE 才起 作用。另外,该引脚被略微拉高。如果微处理器在外部执行状态 ALE 禁止,置位无效。
DS1820 DS1820 DS1820
AT89C51 单片机 P1.0
P1.1
P1.2
P1.3
显示单元 按键控制单元
DS1820
P3.4
图 1-1 DS1820 多线连接方案 2.2.AT89C51 单片机简介 AT89C51 是一种带 4K 字节 FLASH 存储器(FPEROM—Flash Programmable and Erasable
不仅是模拟电路、数字电路、模/数混合电路的设计与仿真平台, 更是目前世界最先进、 最完整的多种型号微控制器系统的设计与仿真平台。 它真正实现了在计算机上完成从原 理图设计、电路分析与仿真、单片机代 码级调试与仿真、系统测试与功能验证到形成 PCB 的完整电子设计与研发 过程。Proteus 产品系列也包含了革命性的 VSM 技术,可以对 基于微控制 器的设计连同所有的外围电子器件一起仿真。首先启动 Proteus 并从 Proteus 元件库中选择需要的元件,绘制电路图并设置相应元件的参数值。
/PSEN:外部程序存储器的选通信号。在由外部程序存储器取指期间,每个机器周期 两次/PSEN 有效。但在访问外部数据存储器时,这两次有效的/PSEN 信号将不出现。
/EA/VPP:当/EA 保持低电平时,则在此期间外部程序存储器(0000H-FFFFH),不管 是否有内部程序存储器。注意加密方式 1 时,/EA 将内部锁定为 RESET;当/EA 端保持高 电平时,此间内部程序存储器。在 FLASH 编程期间,此引脚也用于施加 12V 编程电源(VPP)。
2
中原工学院信息商务学院外文翻译
1.3 单点与多点温度传感器
目前市场主要存在单点和多点两种温度测量仪表。对于单点温测仪表,主要采用传 统的模拟集成温度传感器,其中又以热电阻、热电偶等传感器的测量精度高,测量范围 大,而得到了普遍的应用。此种产品测温范围大都在-200℃~800℃之间,分辨率 12 位, 最小分辨温度在 0.001~0.01 之间。自带 LED 显示模块,显示 4 位到 16 位不等。有的仪 表还具有存储功能,可存储几百到几千组数据。该类仪表可很好的满足单个用户单点测 量的需要。多点温度测量仪表,相对与单点的测量精度有一定的差距,虽然实现了多路 温度的测控,但价格昂贵。 针对目前市场的现状,本课题提出了一种可满足要求、可扩 展的并且性价比高的单片机多路测温系统。通过温度传感器 DS18B20 采集,然后通过 C51 单片机处理并在数码管上显示,可以采集室内或花房中四处不同位置的温度,用四个数 码管来显示。第一个数码管显示所采集的是哪一路,哪个通道;后三个数码管显示所采 集通道的温度值,精确到 0.1 度。