Wireless Home Gateway Based on Embedded Linux and arm

Source: Internet
Author: User

With the rapid development of network technology and information appliances, more and more families require the establishment of a home network. The home gateway is the core of the entire home network. It implements Internet access, remote control, and the function of connecting to a heterogeneous subnet in the home. The home gateway based on the PC solution is not only costly, but also requires that the computer is always in the starting state and can communicate with each other, and cannot run any software or hardware that interferes with communication tasks on the computer. Therefore, in order to adapt to common users, the home gateway should be designed as a non-PC device based on cheap prices. However, if an 8-bit or 16-bit single-chip microcomputer is used, it is difficult to implement the TCP/IP protocol because of its slow speed and limited resources.

Therefore, this article uses the 32-bit embedded microprocessor of the ARM core as the hardware platform, combined with wireless communication technology, by porting the embedded operating system Clinux, it also develops the corresponding drivers, applications and Embedded Web servers on it to implement a convenient and practical home gateway.

System Hardware Design

System structure and working principle

As shown in System Structure 1 of the home gateway, it uses Samsung's 32-bit Proteus processor b0x as the core and uses the extended memory (Flash/SDRAM), bluetooth module, LCD screen, keypad, Ethernet interface module, telephone voice control module, and infrared transceiver module to build a hardware platform and implement multiple control modes.


Figure 1 home gateway system structure

1) local control with a keyboard and display: The system is equipped with 16 buttons and a 128x32 dot matrix LCD, allowing you to set and query the status locally, such as data query and electrical control.

2) Local infrared remote control: the infrared remote control module with self-learning function can realize the infrared remote control of indoor appliances.

3) remote telephone voice control: This is a remote telephone control based on the public telephone exchange Network (PSTN). It is used for telephone command control, such as remote control of household appliances and telephone alarms.

4) Internet-based Remote Control: the browser-side/server-side structure (B/S structure) is adopted. You can directly use the IE browser that comes with windows as the client program, to achieve remote control anytime, anywhere.

Wireless communication technology is the most ideal technology for realizing the home network, which can save the trouble of re-wiring within the home. In the design of the home gateway, the bluetooth module is used as the wireless communication module and the underlying functional modules communicate with each other.

Hardware circuit composition

The hardware design of this system mainly includes the basic hardware platform built with the core of the embedded microprocessor, as well as the hardware design of Bluetooth communication, telephone voice control and infrared remote control modules.

The module 2 shows the function and Interface Circuit Analysis of the Basic System of the basic hardware platform with b0x as the core.


Figure 2 diagram of the home gateway basic hardware platform

ARM microprocessor b0x: b0x is the SOC of the ARM7 kernel produced by Samsung. It is suitable for handheld devices and common embedded applications by expanding a series of general peripheral devices based on ARM7TDMI content.

Flash memory interface circuit: Flash chips are used to store embedded operating systems, home network servers, CGI gateway applications, and file systems required to support various services in the home gateway. In the system, a 16-bit flash memory system is built using hy29lv160, and its storage capacity is 2 MB. After the system is powered on or reset, the command is obtained and executed. Therefore, the flash memory is configured to Rom/SRAM/flash bank0.

SDRAM interface circuit: the embedded operating system requires a certain amount of dynamic RAM. After decompression, the operating system will be moved from flash to SDRAM, and the memory will reside, user stacks and running data are also stored in SDRAM. The 8 K cache provided by the b0x chip is far from enough. Considering the actual application requirements, Samsung's k4s281632d is selected in the design. Its data width is 16 bits and consists of 4 banks with a storage capacity of 16 Mb. The bank6 and bank7 of b0x support SDRAM, so they can be easily connected. In the bus width control register bwscon, set the bank6 data width to 16 bits.
In the control register bankcon6, set Mt = 0x3, trcd = 0x0, scan = 0x01, and set bk76map = 0x110 in the storage capacity register banksize.

10/100 M Ethernet interface circuit: The b0x contains Ethernet MAC control, but does not provide physical layer interfaces. Therefore, an External Physical Layer Chip is required to provide an Ethernet access channel. Rtl8201 is selected in this design. Because there is a Mac controller with the mii interface in the b0x chip, and rtl8201 also provides the MII interface, the definition of various signals is also very clear, so the connection between the rtl8201 and the b0x is relatively simple, during connection, you only need to interconnect the corresponding pins of the two chips. It is worth noting that rtl8201 using the CMOS process cannot be directly connected to the RJ45 interface. Due to the difference of the level signal and the existence of the network impact signal, the two must be isolated and the components for level signal conversion, the hr61h58l Network Transformer is selected in this design.

Serial Interface Circuit: To complete communication with the Bluetooth communication module, infrared transmitting and receiving module, and telephone voice control module of the home network, the home gateway needs an asynchronous serial communication interface, because b0x only has two asynchronous serial ports, you need to expand the serial ports. In this design, an st16c554 chip is selected for serial port expansion. Because the high and low level signal defined by the lvttl circuit of the b0x system is different from the high and low level signal defined by the RS-232-C standard, the communication between the two must pass through the signal level conversion. Here, max202 is used to convert the serial port data signal to TTL level, and then the interrupt request is output through st16c554. The interrupt requests of Four serial ports are used for or calculation to generate the IRQ signal intreq, and then connected to the terminal controller of the CPU through CPLD.

IIC interface circuit: b0x contains an iic bus main controller, which can be easily connected to various devices with IIC interfaces. In this system, the extended at24c01 is used as the IIC memory. At24c01 provides a 128-byte EEPROM storage space, which can be used to store a small amount of data to be stored when the system powers down, such as the parameter settings of the home gateway and the user identity verification code.

LCD display module: This module can use the lm057qc1t01 produced by sharp. It is a Graphic Lattice 256-color stn LCD module with a resolution of 320x240. Because both the b0x and lm057qc1t01 have strong versatility, it is easy to connect, but a circuit capable of Voltage Deflection must be installed between the Controller and the LCD interface, to achieve the 27v deflection voltage required for output LCD display.

Keyboard interface circuit: Uses 8 Universal I/O ports to form a 4x4 keyboard.

Other peripheral circuits required by b0x: JTAG interface circuit (for JTAG debugging), reset circuit, and power supply circuit.

Other functional modules: In this solution, the Bluetooth hardware chip uses the ROK 101008 module of Ericsson. The home gateway is developed by installing bluez with the bluetooth module in the Clinux operating system and establishing related protocols based on The L2CAP layer.

Telephone Voice Control Module: The telephone voice control module is composed of Dual-audio dial-up Chip dtmf8870, speech synthesis chip isd1420, bell flow detection chip circuit, and 89C51.

Infrared Remote Control Module: an infrared receiving module and an infrared transmitting module are added to the system. The infrared receiving module selects ba5302, and the infrared signal is input from the top. After amplification, shaping, and demodulation, it is converted into a digital signal of TTL level; the infrared emission module modulated and sent the learned infrared original code. Here, it uses the software encoding method to generate the modulation signal, so the circuit is very simple.

System software platform

The establishment of a Clinux development environment based on the Clinux operating system application development environment is generally composed of the target system hardware development board (b0x Development Board) and the host PC. The kernel compilation and application development and debugging of the operating system used by the target board must be completed through the host PC. Generally, the two are connected through a serial port, a parallel port, or an Ethernet interface. First, install the standard Linux operating system on the host, and then establish a cross-development environment. Download the tool chain from the Internet and install the cross compiler on the host machine. You also need to reconfigure and compile the kernel based on the needs of the home gateway for Clinux transplantation. The Clinux-Samsung/images directory contains two kernel files: image. Ram and
Image. Rom. The image. Rom is burned into the flash memory corresponding to Rom/SRAM/flash bank0. When the system is reset or powered on, the kernel will automatically decompress it to the SDRAM and start running. Such an embedded application development platform is successfully built.

The development of hardware drivers and applications should also be carried out in the Cross-compiling environment. First, the software should be developed on a PC, then transplanted to the target machine for debugging, and finally solidified to the target machine. The hardware drivers to be developed in this design include: ethernet card controller, serial port, LCD driver, bluetooth module, and keypad driver. Writing drivers for linux kernels is not as complicated as other operating systems. You only need to write several basic functions for the corresponding devices and register them with VFS, generally, a special hardware device is modified based on a ready-made driver. Based on the embedded operating system, a micro GUI should also be developed to compile dynamic web pages and CGI programs to implement embedded WEB technology, security authentication, and wireless communication protocols. For example, Internet-based remote control allows you to view the Web
The remote control program needs to extract useful control command information from the user access information, and then form a command frame according to the internal protocol of the home control network, the key to implementing control is the compilation of CGI programs, as shown in process 3.


Figure 3 Internet remote control program flow chart

Conclusion

This article discusses the software and hardware design of a wireless home gateway based on ARM microprocessor b0x and Clinux. The home gateway has various control methods and can remotely control household appliances by browsing the Web page anytime and anywhere. The home gateway has a low cost and is easy to upgrade to facilitate application promotion.

From: http://blog.csdn.net/java211/article/details/3561544

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.