基于MSP430的空调远程控制系统的多任务设计外文翻译资料

 2022-12-25 14:29:00

2012 3rd International Conference on System Science, Engineering Design and Manufacturing Informatization

Multitasking Design of Air-condition Remote Control System Based on MSP430

Jiantao Chen, Xiaoqin Lian, and Song Wang Beijing Technology and Business University Beijing, China

e-mail:ichenjiantao@126.com, lianxq@263.net, gaosanjiuwang@126.com

Abstract—The widespread use of ZigBee technology in the field of Smart Home makes all sorts of home appliances more intelligent. As a part of Smart Home, an air conditioning remote control system with low power consumption is introduced in this paper. The system utilizes microprocessor MSP430 as the core and ZigBee wireless communication module as intermediary to realize the remote network control of air-condition. On the basis of giving the whole system function, this article states the design method about how to deal with multiple tasks of the system in detail and further elaborates concrete realization processes of air conditioner initialization task, infrared emission task, the temperature setting task and time calibration task. Therefore, it provides a directive method for the design of air conditioning remote control system. Test results show that the system has the characteristics of unobstructed tasks running and low power consumption so that it promises a good application in the future.

Keywords-MSP430; remote control; multitasking; low power consumption

  1. INTRODUCTION

With the continuous improvement of living standards, the traditional life style of household canrsquo;t satisfy peoples needs any more. Building a safe, effective, convenient and comfortable living environment is becoming a popular pursuit. In recent years, the development of ZigBee technology provides a strong support for networking and remote control of home appliances. Remote control not only presents a new kind of household environment, but more important, makes people realize the intelligence, comfort and convenience it brings about.

This paper designs an air-condition remote control system with low power consumption based on the core microprocessor MSP430. It describes the function of the whole system, and further gives concrete realization process of several function setting tasks for air-condition.

  1. SYSTEM STRUCTURE

The air-condition control system can be divided into three layers: the upper is management layer, which achieves the remote control and learns about the operation state of the air-condition through the graphical operation station or Web browser; the middle is ZigBee wireless network layer

978-1-4673-0915-8/12/$31.00 copy;2012 IEEE

composed by CC2530 whose function is taking charge of forwarding commands of the upper layer and reporting control terminalrsquo;s data and responses to the server; the bottom layer is the air-condition control terminals, including MSP430 processor, flash memory M25PE20, temperature acquisition equipment, etc. This layer is charge of completing data acquisition and the realization of the upper instructions.

System work process:

Management layer sends control commands:

When the web server sends control instructions, server instructions will be forwarded through ZigBee network to MSP430 processor. Then, the processor extracts the corresponding infrared control information of air-condition from flash memory. By means of carrierrsquo;s modulation, infrared control information will be emitted by infrared emission circuit so as to achieve the control operation of air- condition.

Bottom layer reports data collection:

Air-condition control terminals will report collected temperature data according to the received instructions, or automatically send the data through the ZigBee wireless network to management server according to the time interval.

Block diagram of the system is described as the Fig. 1 below:

Figure 1. System block diagram

  1. HARDWARE DESIGN OF CONTROL TERMINALS Control terminals of the system mainly complete two

tasks, namely data collection and the achievement of serverrsquo;s instructions. They equip with the quality of two power supply modes, the power supply and the battery power supply. As the processor MSP430F4152, flash memory M25PE20, as also as ZigBee terminal node CC2530 in the

control terminal all have the characteristics of low power consumption, even powered by battery can the control terminal be used for a long time. The SPI interface used in communication between M25PE20 and processor MSP430F4152 improves the systemrsquo;s operating speed. In infrared emission circuit, a transistor amplifier is added to the output IO pin. By using this way of working, emitted signal will become more stable.

The hardware diagram of control terminal is shown as Fig. 2 below:

Figure 2. Hardware diagram of control terminal

  1. THE COMMUNICATION PROTOCOL BETWEEN SERVER AND CONTROL TERMINAL

In the system, management layerrsquo;s instructions are forwarded through ZigBee wireless network and eventually reach the control terminal processor relying on serial interface communication between ZigBee terminal node and MSP430. Therefore, there must be a clear and reasonable communication mechanism, which will be the foundation of interoperability for the whole system. Here the word “interoperability” means the common language, the other word, the same format of instructions when data transmission occurs between ZigBee terminal node and MSP430. So the protocol must consist of start flag, instruction type, the data length, the source address, the destination address and other information needed. Because in this paper, we only have a control terminal, we have no need to set up the source

剩余内容已隐藏,支付完成后下载完整资料


2012年第3届系统科学,工程设计与制造信息化国际会议

基于MSP430的空调远程控制系统的多任务设计

摘要

ZigBee技术在智能家居领域的广泛应用使各种家用电器更加智能化。作为智能家居的一部分,本文介绍了一种低功耗的空调遥控系统。系统以微处理器MSP430为核心,以ZigBee无线通信模块为中介,实现空调远程网络控制。在给出整个系统功能的基础上,本文详细阐述了如何处理系统多任务的设计方法,进一步阐述了空调初始化任务,红外发射任务,温度设定任务和时间的具体实现过程。校准任务。因此,它为空调遥控系统的设计提供了指导方法。测试结果表明,该系统具有运行无阻,低功耗的特点,有望在未来得到很好的应用。

关键词:MSP430;遥控;多任务处理;功耗低

介绍

随着生活水平的不断提高,传统的家居生活方式已不能满足人们的生活需求。 建设安全,有效,便捷,舒适的生活环境正成为人们追捧的热点。 近年来,ZigBee技术的发展为家电的联网和远程控制提供了强有力的支持。 遥控器不仅呈现出一种新的家居环境,更重要的是,让人们意识到它所带来的智能,舒适和便利。

本文基于核心微处理器MSP430设计了一种低功耗的空调遥控系统。 它描述了整个系统的功能,并进一步给出了几个空调功能设置任务的具体实现过程。

系统结构

空调控制系统可分为三层:上层为管理层,通过图形操作站或Web浏览器实现远程控制,了解空调的运行状态; 中间是ZigBee无线网络层由CC2530组成,其功能是负责上层的转发命令,并向服务器报告控制终端的数据和响应; 底层是空调控制终端,包括MSP430处理器,闪存M25PE20,温度采集设备等。该层负责完成数据采集和上层指令的实现。

主要工作流程:

管理层发送控制命令:

当Web服务器发送控制指令时,服务器指令将通过ZigBee网络转发到MSP430处理器。 然后,处理器从闪存中提取相应的空调红外控制信息。 通过载波调制,红外发射电路发出红外控制信息,实现空调控制运行。

底层报告数据收集:

空调控制终端将根据收到的指令报告收集的温度数据,或者根据时间间隔自动通过ZigBee无线网络将数据发送到管理服务器。

该系统的方框图如图所示。

图1.系统框图

控制终端的硬件设计系统的控制终端主要完成两个任务,即数据收集和服务器指令的实现。 它们具有两种供电模式的质量,电源和电池供电。 作为处理器MSP430F4152,闪存M25PE20,也作为ZigBee终端节点CC2530中的控制终端都具有低功耗的特点,即使是电池供电也可以长时间使用控制终端。 用于M25PE20和处理器MSP430F4152之间通信的SPI接口提高了系统的运行速度。 在红外发射电路中,晶体管放大器被添加到输出IO引脚。 通过使用这种工作方式,发射的信号将变得更加稳定。

控制终端的硬件框图如图1所示

Figure 2. Hardware diagram of control terminal

图2.控制终端的硬件框图

服务器和控制终端之间的通信协议

在系统中,管理层的指令通过ZigBee无线网络转发,最终依靠ZigBee终端节点和MSP430之间的串行接口通信到达控制终端处理器。 因此,必须有一个清晰合理的通信机制,这将成为整个系统互操作性的基础。 这里“互操作性”一词是指在ZigBee终端节点和MSP430之间发生数据传输时的通用语言,另一个字,相同的指令格式。 因此协议必须包括开始标志,指令类型,数据长度,源地址,目标地址和所需的其他信息。 因为在本文中,我们只有一个控制终端,我们不需要设置源地址,目的地址。

通信协议格式如下表所示:

表I. ZIGBEE终端节点与MSP430之间的通信协议格式

框架头(起始标志)

框架类型(任务编号)

数据长度

数据

(空调初始化数据或服务器控制

命令)

4 bytes

2 bytes

2 bytes

变量

为了确保上层和下层之间通信的可靠性,在协议中,还设置了底层的响应机制。 在接收服务器的指令时,处理器MSP430必须响应命令的实现状态,以便管理层可以判断是重新发送指令还是采取其他操作。 它与上面图3中的格式相同。

软件设计

我们应该采用传感器字母的格式。 本文设定了一些任务来实现空调控制的目标,如空调初始化,温度设定等。 本部分阐述了软件设计中使用的多任务机制,并在此基础上给出了空调初始化任务,温度设定任务,红外任务任务和时间校准任务四个任务的具体软件设计过程。

实现多任务处理

在软件设计过程中,模块化设计方法适用于每项任务。 每个任务都有自己的任务编号,可以从服务器的指令获取,也可以在其他任务的执行过程中设置,这样就可以很容易地实现任务之间的调用。 考虑到任务没有那么多,每个任务之间的关系是明确的,系统的任务设计采用了设计方法,前台系统和后台系统。 前台系统的功能是通过串口中断接收服务器的指令,提取任务号,然后将后台系统的任务号交给处理。

背景系统的功能是在一个死循环的主要功能中实现的。 主函数循环查询每个任务的任务编号。 如果某个任务编号有效,将执行相应的任务过程。

空调初始化任务

在该系统中,空调初始化任务用于描述将服务器指令存储到控制终端闪存的相应地址中的过程。它是执行其他控制任务的基础。

所有空调控制指令都存储在服务器数据库中。管理层将所有控制指令存储到控制终端闪存的相应地址中。由于闪存具有存储在其中的数据在断电时不会丢失的特性,因此只需初始化就可以直接从闪存中提取所有控制指令以供以后使用。因此,系统控制的效率得到了极大的提高。在完成指令存储后,记下特定闪存页面(例如第31页)中的标记值。当下次接收管理层的初始化命令时,处理器MSP430将首先读取第31页的标记值。如果它与设置值相等,表示初始化已完成,则向服务器报告数据包编号0x01(最后一个数据包编号,无需再次初始化)。如果它不是相等的值,则初始化任务开始并将每个数据包编号返回到上层。

初始化指令格式如下:CC2530 --- MSP430:34 56 70 12 01 90 00 40 ......

MSP430 --- CC2530:34 56 70 12 03 90 00 01

初始化流程图如下图3所示:

图3.初始化流程图

红外发射任务

红外发射任务旨在将从闪存中提取的控制指令转换为红外发射结构并构成红外控制指令。然后红外控制指令由38KHZ载波调制并通过红外发射电路发射,以实现空调控制。设置此任务的主要目的是方便地通过其他控制任务调用,如温度设置任务,时间设置任务等。

图4.红外发射任务的图表

温度设定任务温度设定

任务将完成本文空调温度设定的功能。 当从管理层接收到温度设置指令时,处理器MSP430将根据来自数据包的温度从M25PE20获取控制代码。 控制代码包括当前温度下六种不同的空调运行模式的代码,并被分成微机RAM的阵列。 然后,可以根据接收的操作模式从阵列中提取相应的控制指令。

温度设定的指令格式如下:

CC2530 --- MSP430:34 56 70 12 06 90 00 04 ......

MSP430 --- CC2530:34 56 70 12 07 90 00 09

下面的图显示了温度设定任务的流程图:

图5.温度设置任务的流程图

时间校准任务

控制系统还提供时间校准任务,以校准控制终端LCD上显示的时间。由于终端处理器MSP430F4152具有24小时时间格式的日历功能,不同于校准时间格式,12小时,服务器发送,必须转换24小时的时间格式。

时间校准的指令格式如下:

CC2530 --- MSP430:34 56 70 12 00 20 00 05 ......

MSP430 --- CC2530:34 56 70 12 01 20 00 00

时间校准任务的流程图如图所示。

图6.温度设置任务的流程图

结论

本文分析并实现了基于MSP430的空调遥控系统的设计。 阐述了上层与控制终端之间的协议,分析了多任务机制,重点介绍了空调初始化任务,红外发射任务,温度设定任务和时间校准任务的实现过程。 实际测试表明控制系统运行稳定,功耗低。设计提供了一个针对空调遥控系统具体设计的指导思路,为智能家电的发展奠定了良好的基础。

致谢

这项工作得到了北京市教育委员会科技创新平台项目#PXM2011-014213-113551和北京市教育委员会科技通用计划KM201110011005的支持。我要感谢我的导师对远程空调控制项目的认真指导和建议。

参考文献

Cheng Tianshui, Qin Wen, Hu Tianyou. Design of a learning infrared remote controller based on mega128[J]. Microcomputer amp; Its Applications, 2010, (08).

Wang Ling,Wang Zhongxun, Wang Heng. Multi-spots Wireless Temperature Detecting System Based on MSP430[J]. Modern Electronics Technique, 2011,(01).K. Elissa, “Title of paper if known,” unpublished.

Xie Xinghong, Lin Fanqiang, Wu Xiongying. Basis and Pratical of MSP430 Microprocessor[M]. Press of Beijing University of Aeronautics and Astronautics, 2008

Wu Yongna. The Design of Air-condition Remote Controller Based on ZigBee[J]. Journal of Hebei Software Institute, 2010,(04).

Wu Guangrong,Quan Jianmin, Zhan Jianxiong. Air-condition control system based on ZigBee technology[J]. Mechanical amp; Electrical Engineering Magazine, 2009(07).

Tan Min. The Design of Infrared Remote Control Based on Single- chip Microcomputer[J]. SCIENCE amp; TECHNOLOGY INFORMATION, 2011,(09).

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[20603],资料为PDF文档或Word文档,PDF文档可免费转换为Word

您需要先支付 30元 才能查看全部内容!立即支付

发小红书推广免费获取该资料资格。点击链接进入获取推广文案即可: Ai一键组稿 | 降AI率 | 降重复率 | 论文一键排版