【正文】
MOVC P2, A RET ORG 0090H LEDTAB: DB 0C0H,0F9H,0A4H,0B0H,99H DB 92H,82H,0F8H,80H,90H定時中斷子程序:ORG 0100H TIME: PUSH A SETB SETB MOV P0, 0FFH MOV A, P0MOV B, 10 MUL AB MOV A, 210 CLR C` SUBB A, B MOV B, 10 DIV AB SWAP A ADD A, B CJNE A, R7, CON CON: JNC STOP SETB SJMP TIMEEND STOP: CLR TIMEEND: POP A RETI END外文文獻(xiàn)Temperature Control Using a Microcontroller:An Interdisciplinary Undergraduate Engineering Design ProjectJames S. McDonaldDepartment of Engineering ScienceTrinity UniversitySan Antonio, TX 78212AbstractThis paper describes an interdisciplinary design 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 airfilled chamber. The system was to allow entry of a desired chamber temperature in a prescribed range and to exhibit overshoot and steadystate 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 realworld application. A prototype of a microscope slide dryer had been developed around an OmegaTM model CN390 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, airfilled 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 National 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 CN390 temperature controller using a customdesigned 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 main requirements boil down to焉得諼草,言樹之背,養(yǎng)育之恩,無以回報。謝四年中陪伴在我身邊的同學(xué)、朋友,感謝他們?yōu)槲姨岢龅挠幸娴慕ㄗh和意見,有了他們的支持、鼓勵和幫助,我才能充實的度過了四年的學(xué)習(xí)生活。本文的寫作更是直接得益于他的悉心指點,從論文的選題到體系的安排,從觀點推敲到字句斟酌,無不凝聚著他的心血。他嚴(yán)肅的科學(xué)態(tài)度,嚴(yán)謹(jǐn)?shù)闹螌W(xué)精神,精益求精的工作作風(fēng),深深地感染和激勵著我。此向我的論文指導(dǎo)老師致以最誠摯的謝意?;叵朐谔K州大學(xué)求學(xué)的四年,真的是受益頗多。通過本次畢業(yè)設(shè)計將我大學(xué)四年學(xué)習(xí)的部分知識加以融合和運用,讓我對所學(xué)習(xí)的分散的知識有了更深一步的了解,對自身能力有些許的提高。本次設(shè)計采用了AT89C52單片機(jī)作為核心來實現(xiàn)溫度控制,通過一系列硬件器件和軟件功能來實現(xiàn)空調(diào)溫度控制。而空調(diào)的核心就在于溫度控制這一塊,溫度控制的核心又在于單片機(jī)控制,由此可見空調(diào)的核心在于基于單片機(jī)的溫度控制系統(tǒng)。 將讀取的溫度信號值轉(zhuǎn)換成對應(yīng)的溫度值216。流程圖如下圖15所示:圖15 溫度顯示流程圖溫度顯示程序代碼:ORG 0075HDISPLAY: MOV DPTR, LEDTAB ;LED顯示碼表首 MOV A, 0FH ;取各位 ANL A, R7 MOVC A, DPTR+A MOV P1, A MOV A, 0F0H ;取十位 ANL A, R7 WAP A MOV A, DPTR+A MOVC P2, A RET ORG 0090HLEDTAB: DB 0C0H,0F9H,0A4H,0B0H,99H;共陽顯示碼 DB 92H,82H,0F8H,80H,90H 定時中斷子系統(tǒng)流程圖以及其程序代碼定時中斷程序為本控制系統(tǒng)的核心模塊,根據(jù)環(huán)境溫度控制壓縮機(jī)電路,其工作內(nèi)容主要包括以下3個部分:216。降溫設(shè)置如圖14所示。升溫設(shè)置流程圖如圖13所示:降溫時,先判斷手動設(shè)定溫度是否超過溫度下限,若低于10℃,若低于10℃,則返回,反之,將其值降低1℃。升溫時當(dāng)手按下“升溫”按鍵,單片機(jī)判斷是否大于溫度上限30℃,若沒超過上限,則將其值升高1℃,調(diào)整為十進(jìn)制,顯示新值。 系統(tǒng)總電路圖見附件第五章 軟件系統(tǒng)設(shè)計 主程序模塊以及其流程圖主程序主要包括設(shè)置、顯示默認(rèn)調(diào)節(jié)溫度為20℃和進(jìn)行系統(tǒng)初始化(設(shè)定中斷、定時方式等)工作。此時,要求段驅(qū)動電路能吸收額定的段導(dǎo)通電流,還需根據(jù)外接電源及額定段導(dǎo)通電流來確定相應(yīng)的限流電阻。當(dāng)某段驅(qū)動電路的輸入端為低電平時,該端所連接的字段導(dǎo)通并點亮。共陽極數(shù)碼管中8個發(fā)光二極管的陽極(二極管正端)連接一起,即為共陽極接法,簡稱共陽數(shù)碼管。參數(shù)的確定:按鍵的抖動時間常數(shù)為τ。為防止按鍵按下時的抖動,還需要設(shè)計