用MAXQ3212微控制设计数字温度监控器.pdf
《用MAXQ3212微控制设计数字温度监控器.pdf》由会员分享,可在线阅读,更多相关《用MAXQ3212微控制设计数字温度监控器.pdf(6页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 Maxim/Dallas App Notes MICROCONTROLLERS Keywords:MAXQ3212,MAXQ3210,microcontroller,reduced instruction set,RISC,low pin count package,LPC,thermostat,digital thermomostat,1-Wire,DS18B20,DS28EA00,ICM7218 Nov 30,2006 APPLICATION NOTE 3965How to Use the MAXQ3212 Microcontroller as a Digital ThermostatT
2、his application note describes a digital thermostat based on the MAXQ3212 RISC microcontroller.This simple system senses the ambient temperature,compares it to a user-input set point,and switches an output relay as a result of this comparison.System components also include a 1-Wire digital thermomet
3、er and a 4-digit,7-segment LED display driven by an 8-digit LED display driver.By choosing this microcontroller and the highly integrated display driver,a minimal component count system is achieved.IntroductionThere are situations where temperature regulation and control are desirable.When the ambie
4、nt temperature is too cold,for example,a light bulb can be used as a heat source in a small enclosure to dry or cure paint or similar material.Temperature sensing,power switching,and a basic heat source thus provide a closed-loop temperature-control system for many situations.This application note d
5、escribes how to use a MAXQ microcontroller to implement this type of control system,also called a digital thermostat.The MAXQ3212 is chosen as the system controller because of its functionality,ease of use,low cost,and the ready availability of an inexpensive development environment,the MAXQ3210 Eva
6、luation Kit(MAXQ3210-KIT).The complete development environment for this example code is version 1.0 of the MAX-IDE and revision A of the MAXQ3210 kit board.System Implementation DetailsOverviewThe system implementation for this digital thermostat is quite simple.Figure 1 shows a schematic of the cir
7、cuit.A DS18B20 1-Wire Digital Thermometer measures ambient temperature.The system controller compares the measured ambient temperature to a user-input set point;and a relay is activated if the ambient temperature is below the set point.The system uses a 4-digit LED display to show the ambient temper
8、ature in normal operation and the set point when it is input by the user.A MAXQ3212 serves as the systems controller.It performs the user-interface function(set point up and down)through two pushbutton switches connected to the processor through port pins configured as inputs.Another port pin is use
9、d as a single output dedicated to controlling the output relay.More detailed image(PDF,36.7kB)Figure 1.Thermostat circuit schematic.For the systems display,a 4-digit,7-segment LED was chosen so the thermostat would be usable in a variety of lighting conditions without additional electronics such as
10、backlighting.To simplify the processors interface to the display and to provide the necessary drive current and multiplexing,a Maxim ICM7218AIPI 8-digit LED driver was selected.This device contains all the circuitry necessary to interface the microcontroller directly to the common-anode,LED display.
11、The LED driver drives up to eight digits,although only four digits are used in this application.This device drives each of the 7 segments directly without external current-limiting resistors.The systems output is switched AC power provided by a standard electromechanical relay which switches AC powe
12、r to an arbitrary load and can be sized according to the loads power demand.This relay was chosen because it can switch 8 amps and its coil voltage is 5V,which is the systems supply voltage.The relay can,however,operate from any available power source that does not exceed the voltage or current capa
13、bilities of the final drive FET(BS170).While it is certainly possible to do so,no attempt was made to model the precise behavior of the system and optimize the closed-loop performance.A simple comparison between the actual and desired temperatures is the only output-switching criterion here.The soft
14、wares subroutine Relay_Switch can be modified,as desired,to achieve the desired system behavior.A single DS18B20-PAR measures the ambient temperature.This device has an accuracy of 0.5C over a range of-10C to+85C.In this application,the temperature is expected to range between+12C to+38C(+55F to+100
15、F).The resolution of this device is user-selectable from 9 to 12 bits;the resolution selected for this application is explained below.While it is not used in this application,each DS18B20 contains a unique,64-bit identification number that supports multiple devices on the 1-Wire network.1-Wire Inter
16、faceDallas Semiconductors 1-Wire bus is a unique serial interface that requires a single signal line and ground to perform communications.This interface enables a microcontroller to communicate with a 1-Wire device using a single port pin.This interface also provides power,called parasitic power,ove
17、r the 1-Wire signal line,which allows the 1-Wire device to operate without a local supply.While not important for this application,this independent operation is required in some remote temperature-measuring situations.Although this application requires only a single 1-Wire device,the 1-Wire bus is d
18、esigned to operate with a single master and multiple slaves,i.e.,it is multidrop.While this application uses a single DS18B20 device for temperature measurement,there are several devices from Dallas Semiconductor that perform this function.For instance,in applications sensing temperatures in multipl
19、e locations,the DS28EA00 is designed specifically for multidrop applications,and it simplifies the detection of the physical sequence of 1-Wire devices in a 1-Wire network environment.In this thermostat application,a single port pin is used to bit-bang and communicate over the 1-Wire bus.The softwar
20、e for this function comes directly from Application Note 3769,Building a 1-Wire Temperature Logger Using the MAXQ3210.This code was written specifically for the MAXQ3210 microcontroller and the DS1822 Econo 1-Wire Digital Thermometer.Only a minor modification was required to change the resolution fr
21、om nine bits in the original software to 10 bits in this application.Application Note 3769 also provides references for the 1-Wire bus and its applications.MAXQ3212 I/O PinsThe MAXQ3212 has 15 port pins:8 for port zero,and 7 for port one.To interface with the ICM7218 display driver,a minimum of 10 s
22、ignals(port pins)is required.Four other signals are required to interface with the temperature up switch,the temperature down switch,the relay driver,and the DS18B20.This makes the total requirement 14 port pins.In normal reset default operation,four of the MAXQ3212s 15 port pins are used for the JT
23、AG interface(P1.0,P1.2,P1.3,and P1.4)and one for the reset input(P1.1)function.Although these five signals control debug functions,they are needed for this application.Consequently,some consideration was given to the overall debugging strategy.The default debug functions of these five port pins can
24、be disabled by setting the control bits TAP and RSTD to their appropriate levels(0 and 1,respectively).When disabled,the port pins allocated to these debug functions behave as ordinary port pins,and the debug operations are no longer available.Therefore,the final application software routines debugg
25、ed were the display operations.Display operations were chosen because they require the largest number of I/O pins,and the functions are relatively uncomplicated and need little debug.The assembly language code has a large delay(approximately 5 seconds)inserted before the instructions to disable thes
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- MAXQ3212 控制 设计 数字 温度 监控器
限制150内