Design and implementation of home intelligent terminal based on LPC2214

Publisher:沈阳阿荣Latest update time:2012-08-24 Source: 21ic Keywords:μCOSII  LPC2214  Socket Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Smart home refers to the use of advanced computer technology, network communication technology, and integrated wiring technology to organically combine the subsystems related to home life, and make home life more comfortable, safe, and effective through overall management. As an important part of the intelligent community, the smart home platform realizes home intelligence through its core - the home smart terminal. The smart home terminal can realize the functions of system information collection, information input, logic processing, information output, linkage control, etc. The early home smart terminal network was based on the telephone network to achieve remote monitoring and remote control. Due to the bandwidth limitation of the telephone network and the high cost of use, home smart terminals cannot be promoted. With the development of computer technology and communication technology, remote communication based on IP technology has become the focus of home smart terminal development. At present, remote communication devices based on 8-bit single-chip microcomputers and TCP/IP protocols have appeared in large numbers. However, due to the limitations of the operating frequency and storage capacity of 8-bit single-chip microcomputers, the operating system and the complete IP protocol cannot be transplanted, and the real-time and reliable communication of remote monitoring and remote control and large amounts of data are difficult to guarantee, which has become a bottleneck in the development of home smart terminals. Using mature ARM chips and μCOS-II operating systems can effectively solve this problem.
ARM (Advanced RISC Machines) is a reduced instruction set computer that integrates typical RISC structural features. In addition, the ARM architecture also has features such as addressing modes with automatic increase and decrease of addresses, multi-register load and store instructions, etc.
Since its initial development, ARM has gone through 5 major ARM instruction set architectures, represented by version numbers V1~V5. Common ARM7, ARM9, ARM10, and SecurCore series chips are all architectures above ARM V4. The ARM7TDMI series chips are currently the most widely used ARM chips. They are widely used in multimedia and embedded devices, including Internet devices, network and modem equipment, as well as wireless devices such as mobile phones and PDAs.
PLC2214 is a cost-effective ARM7TDMI (-S) chip produced by Philips, mainly used in Internet gateways, serial protocol conversion, access control and other fields.
1 System structure and hardware composition of home smart terminals
1.1 System structure of home smart terminals
Home smart terminals are the core equipment of home intelligence and the transfer station between the home internal network and the external network. It realizes various functions through various protocol conversion modules and networking methods. The home intelligent terminal proposed in this paper mainly has the following functions: security protection, linkage control, remote control and monitoring, information collection, and home information management. The external network uses the local area network to transmit information with remote terminals (user terminals, community management terminals, charging terminals, etc.). In addition, considering the instability of the Internet, the system also reserves a PSTN interface to increase system redundancy. RS-485 bus and Bluetooth technology are used to realize the internal network of the home, combining wireless and wired to meet the needs of more devices. The network system of the home intelligent terminal is shown in Figure 1.


1.2 Hardware Implementation of Home Smart Terminal
This paper uses LPC2214-S as the central control chip. LPC2214-S is a microcontroller based on a 16/32-bit ARM7TDMI-S CPU with real-time simulation and tracing, and has 256KB of high-speed on-chip Flash memory. The on-chip 128-bit wide memory interface and accelerator structure can achieve an operating frequency of up to 60MHz. LPC2214 also integrates 16KB of SRAM on the chip and provides rich interface resources, including 2 16C550 industrial standard UART asynchronous serial ports, 1 high-speed I 2 C interface (400Kbps), 2 SPI interfaces and 112 GPIO ports. Its on-chip Boot loader can realize in-system programming (ISP) and in-application programming (IAP). In addition, the chip provides two low-power modes: idle and power-down.
It can be seen that LPC2214-S has the characteristics of high performance, low power consumption and rich interface resources. These characteristics can better meet the design needs of network-based home smart terminals.
As the control center of home automation, the home intelligent terminal has not only LAN interface, PSTN interface, RS-485 interface, and Bluetooth interface, but also provides audio and video interface, HUB interface, RS-232 interface, alarm sensor interface, etc. These interfaces can realize functions such as automatic switching of audio and video, simultaneous Internet access of multiple PCs, and combining with PC to complete family affairs management. Figure 2 is a hardware implementation diagram of the main control module of the home intelligent terminal.


1.3 Working Principle of Home Smart Terminal
Using a remote control device based on Bluetooth technology or a wired keyboard based on RS-485 bus, you can set various parameters of the home smart terminal, turn on or off the 485 bus or electrical equipment with Bluetooth module, set the alarm mode of the alarm module, and disarm and arm. In addition, there is an emergency help button on the remote control device and keyboard, which can send an alarm signal to the remote management center via telephone and network. The home smart terminal also has a linkage control module. When a device on the 485 bus or Bluetooth network takes a certain action, it can trigger other devices to make a set state change, thereby achieving the effect of convenience for users and saving energy. The above is an introduction to the working principle of local operation. Regarding remote control and remote monitoring, this article provides two methods: based on the telephone network and based on the Internet. Since there have been a lot of introductions to remote control and remote monitoring based on the telephone network, this article mainly introduces remote control and monitoring based on the Internet. [page][page]

void SWI_Exception(int SWI_Num,int*Regs)
{
OS_TCB *ptcb;
switch(SWI_Num)
{
case 0x02:/*Disable interrupt function OS_ENTER_CRIIICAL()*/
__asm
​​{
MRS R0,SPSR
ORR R0,R0,#NoInt
MSR SPSR_c,R0
}
OsEnterSum++;
break;
case 0x03:/*Enable interrupt function OS_EXIT_CRIIICAL()*/
if (--OsEnterSum == 0)
{
__asm
​​{
MRS R0,SPSR
BIC R0,R0,#NoInt
MSR SPSR_c,R0
}
}
break;

}
In addition, this file also includes the function void OSStartHighRdy(void) that calls the highest priority task before the system starts when running multiple tasks, as well as several Hook functions for users to write.
OS_CPU_A.ASM includes four simple assembly language functions: calling the highest priority task function before startup, OSStartHighRdy(), OSCtxSw() and OSIntCtxSw(), and OSTickISR(). The task switching function uses the stack to save the useful state of the switched task before the task switching. LPC2214 has 17 registers, but not all registers need to be put into the stack. In order to save stack space and reduce the time overhead during switching, a stack structure for task switching is established, as shown in Figure 4.


2.3 Remote monitoring and remote control
The software design of remote monitoring and remote control adopts the client-server mode. The transport layer of the TCP/IP protocol has two data transmission protocols: the Transmission Control Protocol TCP and the User Datagram Transport Protocol UDP, each with its own characteristics. The UDP protocol is a protocol that provides the least service and cost. It does not transmit data based on a connection, so the data transmitted by UDP is unreliable. The TCP protocol is a reliable data transmission protocol for bidirectional transmission based on a connection, but the cost of using the TCP protocol is relatively high. In the design of the intelligent terminal, the convenience and reliability of data transmission are fully considered, and in view of the fact that the ARM system can provide sufficient resources, different transport layer protocols are adopted according to different data requirements. In the software design, the Socket API function is used to write UDP and TCP communication tasks. When TCP and UDP communicate, the application process of the Socket API is shown in Figure 5.


The home smart terminal is a platform for information exchange and home appliance control inside and outside the home. This paper uses Philipes' ARM7 chip LPC2214 to design hardware and software, overcoming the limitations of slow processing speed, insufficient interface resources and storage resources of 8-bit microcontrollers. RS-485 and Bluetooth networks are used as the internal network of the home, and the local area network and telephone network are used as the external network to ensure the stability and reliability of large data transmission, and take into account the traditional telephone network remote control method. Practice shows that the system has good real-time performance and stability, and has great development potential in the field of high-end home smart terminals.

Keywords:μCOSII  LPC2214  Socket Reference address:Design and implementation of home intelligent terminal based on LPC2214

Previous article:Design of autonomous mobile robot based on LPC2119
Next article:Application of SPI bus technology based on LPC2103

Recommended ReadingLatest update time:2024-11-16 22:36

Application Research of SOCKET Communication Based on GPRS
introduction    GPRS (General Packet Radio Service) is the abbreviation of General Packet Radio Service, which is a data transmission technology based on the Global System for Mobile Phones (GSM) . The GPRS network not only has the advantages of wide coverage, fast data transmission speed, high communication quality
[Microcontroller]
Application Research of SOCKET Communication Based on GPRS
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号