Design of Simulating Home Gateway Using SX52 Single Chip Microcomputer

Publisher:MysticJourneyLatest update time:2012-11-29 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

Information appliances (3C or IA) are no longer a strange name to people. They are innovative products that combine computer, telecommunication and electronic technologies with traditional home appliances. They are new home appliances designed for digitalization and network technology to penetrate deeper into family life. To connect them with external networks (such as the Internet) for information exchange, using home gateways for centralized management is undoubtedly an ideal solution.

The home gateway is such a simple, intelligent, standardized and flexible interface unit for the entire home network, which can receive communication signals from different external networks and transmit the signals to a consumer device through the home network. However, the standards for the architecture and function allocation of the home gateway have not yet been determined, and research on it is in full swing.

This paper uses the SX52 embedded network single-chip microcomputer integrated development system main module to simulate the home gateway, and uses its peripheral expansion modules to simulate information appliances, thus successfully building a hardware and software platform that simulates the interaction between the home gateway and information appliances. This simulation of the home gateway and information appliances using a single-chip microcomputer integrated system provides an experimental platform for studying the internal architecture of information appliances and the functional allocation of home gateways and information appliances, while greatly saving resources and costs.

2 Theoretical research

2.1 Information Appliances

Information appliances are all home appliances that can exchange information through a network system. In other words, information appliances integrate digital technology and network technology into traditional home appliances such as refrigerators and washing machines and use this as a basis to establish a home network environment. Information appliances have the following characteristics: (1) They are connected by wired or wireless means, can recognize each other, work together and network; (2) They can follow certain protocols and exchange information with external networks through home gateways or directly; (3) They have single functions[1] and are simple to use; (4) They are real-time, digital and intelligent; and (5) They use embedded operating systems.

According to these characteristics, we divide its internal architecture into two upper and lower module layers. The upper layer is the software module, which includes the application layer (such as service registration, application protocol interpretation, etc.), the embedded operating system layer (such as embedded Linux, WinCE, etc.), the device driver layer (such as LCD display driver, touch screen driver, etc.), and the lower layer is the hardware module, including the core motherboard (including embedded processor chips such as S3C2410, etc.), home appliance hardware and control layer (with built-in control module), and peripheral chips (such as RTL8019AS, Bluetooth, etc.). Among them, the core motherboard is the main controller, and information appliances interact with the outside world through peripheral chips. Under the control of the core motherboard, they communicate with the home appliance control module in a two-way manner, thereby realizing the monitoring of home appliance hardware. The embedded operating system mentioned here will be used in the future as the functions of information appliances increase and become stronger. This article does not discuss it in the simulation system implemented on a single-chip microcomputer with limited resources.

2.2 Home Gateway

Individual information appliances can also have the function of directly connecting to the Internet, but with the help of existing computer network technology, various home appliances and devices in the home can be connected to the Internet, and various rich, diverse, personalized, convenient, comfortable, safe and efficient services can be provided to people through the home network. All information appliances are connected to form a home network, and the function of accessing the Internet is moved to the home gateway, which is responsible for information exchange with the Internet. This will not only reduce the load of information appliances and reduce costs, but also promote home networking, because different protocols can be used within the home network, which is more flexible. Therefore, to realize the exchange of information between the home network and the outside world, it is necessary to design an ideal home gateway.

The two main functions of a home gateway are: (1) serving as a physical interface between the home network and the external network; and (2) providing a platform for residential users to obtain a variety of home services (including existing services and services that may appear in the future, such as being able to open a friend's DVD player to watch a movie after authorization).

The current consensus on effective solutions for home gateway interfaces is to develop a centralized gateway, which will provide the most effective solution for bridging external networks and home networks or devices. In addition, using a PC as a home gateway is too large and has poor environmental adaptability. In addition, two network adapters must be installed (one for connecting to the Internet and one for connecting to the internal network), and the total cost is higher than that of a dedicated gateway. Therefore, it is completely necessary to design a dedicated gateway. In view of the functional characteristics of the home gateway, its logical structure should be as shown in Figure 1.

Figure 1 Logical structure of home gateway

3 pieces of selection

3.1 Features of SX52

How to use the limited resources of the microcontroller to process the information with TCP/IP protocol and turn it into IP data packets that can be transmitted on the Internet? There are currently two solutions: one is PC gateway + dedicated network, the disadvantage is that it requires additional wiring and third-party protocol conversion software; the other is 32-bit MCU + RTOS, the disadvantage is that it is difficult to develop and the cost is extremely high. Compared with the chip with integrated network protocol, the software method to implement network protocol has the advantages of saving space and reducing costs. More importantly, various protocols can be configured or even modified at will, and can be updated with future development through software upgrades.

The SX52 microcontroller from Ubicom has this advantage. Its main features are: (1) fast speed, reaching 100 MIPS at 100 MHz; (2) ready-made network protocol modules for application, which can run network protocol stacks such as TCP, IP, HTTP, and SMTP through virtual peripheral functions; (3) powerful virtual peripheral functions, that is, flexible configuration of I/O ports through software, and CPU execution of virtual software modules can drive ordinary I/O ports to simulate peripheral functions such as UART, SPI, IIC, and FSK. It is very appropriate to use its successful network protocol modules and some practices suitable for small embedded systems to build field control.

3.2 SX52 main functional modules

3.2.1 CPU module (including online download ISP circuit)

This module realizes the system control of the development system board and realizes the network interface control, mainly including SX52BD. SX52BD is the main CPU of the development system board. It is a high-speed 8-bit microcontroller with RISC instruction set, with 4K×16-bit Flash memory and 262×8-bit RAM on the chip. Due to the use of CPU parallel pipeline mode and single clock cycle instructions, the instruction execution speed can reach 100MIPS. This microcontroller can be widely used in occasions that require network support, especially suitable for applications that require remote monitoring. The network protocols (IP, ARP, DHCP, UDP, TCP, HTTP, SMTP) implemented by the development system board are realized through this chip.

3.2.2 Network interface module

This module implements two network interface modes: Ethernet interface and modem interface, mainly including RTL8019AS, Ethernet transceiver filter chip, MAX232, etc.

3.2.3 User test area module[page]

The signal pins of the main CPU have been connected to the periphery of the user test area, with 5 groups of 40 signal lines in total. Developers can use these signals to perform corresponding peripheral circuit expansion tests in the test area.

4 Design and implementation of the pseudo-system

4.1 Hardware Design and Implementation

This article chooses SX52 as a platform for simulating the interaction between information appliances and home gateways, which is very suitable because we use its user test area module to expand the peripheral module circuit (such as refrigerator remote control module) to simulate information appliances, and use the main module to simulate the home gateway to achieve control of information appliances through remote terminals (Web browsers or dedicated control clients). This article only discusses the use of dedicated control clients to achieve remote control of home appliances through serial port communication.

An infrared remote control transmitter circuit (main chip CS5104) is added to the board to simulate a refrigerator, which can realize the remote control function of the refrigerator. At the same time, in order to understand the remote control effect of the development system, a remote control receiver circuit (main chip CS8206) is also added to respond to the remote control signal of the transmitter circuit. A remote control receiver status LED (9 pieces) is also added to display the status of the refrigerator. The hardware block diagram is shown in Figure 2. This article only gives the block diagram containing the refrigerator module, and adding other modules is similar.

Figure 2 System hardware block diagram

Figure 2 System hardware block diagram

4.2 Software Design and Implementation

To control information appliances through a dedicated control client, the control protocol must first be defined so that the information sent from the client can be unpacked by the home gateway to extract valid information and then converted into a control command to be sent to the information appliance to perform the correct operation. The system workflow is as follows:

(1) Initialize the main chip and peripheral chips after the development system board is powered on.

(2) Open the client program as shown in Figure 3.

(3) Configure the various options for controlling the refrigerator as needed. Click "OK" to start the refrigerator module on the development board. Then the service request sent by the client program (including the authentication request for connecting to the home gateway) passes through the RTL8019AS on the development board and is interpreted and verified by SX52. If the verification is successful, the converted request information is sent to the refrigerator remote control transmitter chip under the control of SX52. The chip sends the remote control signal to the remote control receiving circuit, which responds to the remote control request through the corresponding LED display. Finally, by observing whether the display status on the control interface is consistent with the corresponding LED display on the development board (the slider indicating the temperature on the interface is designed with only three fixed temperatures, which are displayed separately by three LEDs on the development board), the simulation system can be verified to see if it is running successfully.

Figure 3 Dedicated control client interface

Figure 3 Dedicated control client interface

Considering the processing power of the single-chip microcomputer, defining a single character to transmit control information can not only save resources, but also shorten the response time and meet higher real-time requirements. Taking the simulation of the refrigerator module as an example, the information sent by the client program to the gateway is extracted by the gateway and forwarded to the refrigerator module. The specific implementation of the control protocol is as follows: "e" represents closing, "t" represents setting temperature (considering the limited processing power of the single-chip microcomputer, only "high, medium and low" are used to represent the temperature setting value), "s" represents starting/freezing speed (fast, standard, slow, and the default is standard after starting), and "m" represents working mode (power saving mode and normal mode). After selecting each option and pressing "OK", the control information is sent to the home gateway (SX52) in the form of a datagram. The home gateway then unpacks the package, extracts the effective control information from the client, and converts it into a form that can be recognized by the refrigerator module of the simulated information appliance, and finally sends it to the refrigerator module through the I2C bus. The corresponding lights behind will brighten or dim according to the defined rules, and the state of the slider indicating the temperature will also change accordingly.

According to the protocol established above, create the client and add and modify the code in the corresponding files, and then follow the steps below to complete the final work:

(1) Create a client to implement the above protocol and display the control status information of the refrigerator. The page appearance is shown in Figure 3.

(2) Modify the i2c_uartdemo.src source file, change the serial port connection mode to Ethernet connection mode, and add refrigerator initialization code, interrupt code and protocol conversion module.

(3) Use the assembler/programmer software SXKey52.exe to download the file i2c_uartdemo.src to the development system board, and then use the client program running on the PC (as shown in Figure 3) to control the refrigerator hardware circuit on the development board.

5 Conclusion

Starting from the study of home gateways and information appliances, this paper selects a high-performance 8-bit SX52 microcontroller integrated system and performs hardware and software tailoring. It successfully uses peripheral hardware circuits and virtual peripherals and network protocol software virtual modules to build an embedded experimental platform that simulates home gateways and information appliances, laying a solid foundation for further research on the internal structure of home gateways and information appliances and the functional allocation between the two.

References

[1] Qin Bo, Zhang Jun, Design of a Security Gateway Based on Embedded System, Microcomputer Information, Vol. 21, No. 8-2, 2005

Reference address:Design of Simulating Home Gateway Using SX52 Single Chip Microcomputer

Previous article:Audio and video acquisition system based on MPC5200
Next article:Function and application of PCI9052 interface circuit

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号