The application scheme of wireless LAN equipment based on S3C2410X embedded microprocessor

Embedded system refers to a special-purpose computer system that is based on computer technology, application-centric, software and hardware can be tailored, and has strict requirements on functionality, reliability, power consumption, volume, and cost. Pursue the goal of “short, small, light, thin, power saving, fast, and low cost”. Embedded system equipment has been widely used in manufacturing industry, process control, instrumentation, military equipment, consumer products and other fields.

Author: Zhang Liucheng

1 Introduction to Embedded System

Embedded system refers to a special-purpose computer system that is based on computer technology, application-centric, software and hardware can be tailored, and has strict requirements on functionality, reliability, power consumption, volume, and cost. Pursue the goal of “short, small, light, thin, power saving, fast, and low cost”. Embedded system equipment has been widely used in manufacturing industry, process control, instrumentation, military equipment, consumer products and other fields. Embedded system is composed of software and hardware, generally divided into five parts: processor, memory, input and output, operating system and application software. As shown in Figure 1:

The application scheme of wireless LAN equipment based on S3C2410X embedded microprocessor
Figure 1: Structure diagram of embedded system

The initial application of the embedded system is based on a single-chip microcomputer. It only uses an 8-bit chip to execute some simple single-process programs. There is no multi-process task scheduling, and there is no system to talk about. With the advent of 16/32-bit embedded microprocessors, embedded systems have begun to introduce embedded operating systems, which frees application developers from small-scale development and enables embedded applications to have a broader space. Well-known embedded operating systems include ISI’s pSOS, WindRiver’s VxWorks, QNX’s QNX, Microsoft’s WinCE, and open source Linux and uC/os.

2 Overview of WLAN

Wireless local area network (Wireless Local Area Network, WLAN) is a short-distance wireless communication technology, which is a combination of modern computer network and wireless communication technology. Transmit data, voice and video signals in the air through radio frequency (RF) or infrared (Infra Red, IR) technology. The wireless local area network can make up for the deficiencies of wired Ethernet that relies on cables or optical cables in some special application environments, and realize the extension of the network.

The physical layer of the wireless local area network standard defines two radio frequency transmission methods and one infrared transmission method. There are three frequency bands used by the RF method: L band (902MHz~928MHz), S band (2.4GHz “2.4835GHz), C band (5.725GHz” 5.85GHz). The S frequency band is generally used. This frequency band is called the ISM (Industry Science Medical) frequency band, that is, the industrial science medical frequency band. The ISM frequency band is not restricted by the Federal Communications Commission (FCC) and belongs to the industrial free radiation frequency band. Wireless local area networks working in this frequency band have two spreading methods: Direct Sequence Spread Spectrum (DSSS) and Frequency Hopping Spread Sprectrum (FHSS).

In June 1997, the IEEE passed the standard for wireless local area networks, the 802.11 standard. The formulation of the IEEE 802.11 wireless local area network standard is a milestone in the development of wireless network technology. The standard mainly stipulates the physical layer (PHY) and media access control layer (MAC) of the network, of which the MAC layer is the focus.

The 802.11 speed can only reach 2Mbps, which cannot meet the needs of people. The IEEE group has introduced the 802.11b standard. IEEE802.11b works in the 2.4GHz frequency band, adopts direct sequence spread spectrum DSSS technology and compensation code keying CCK modulation method, which can provide multiple rates of 11Mb/s, 5.5Mb/s, 2Mb/s, 1Mb/s, and at 2Mb It is compatible with IEEE802.11 at speeds of 1Mb/s and 1Mb/s. 802.11b is currently the most mature and used wireless LAN standard. This article uses IEEE-802.11b wireless network card.

At present, people’s application of wireless local area network technology is only limited to PCs and notebooks, and is generally used in hot spots (Hot Spot) distribution areas. The embedded system integration of wireless local area network technology to achieve wireless communication and data transmission will become a hot spot for future applications. For example, wireless digital set-top boxes, computers, wireless gateways and household appliances can form a home wireless local area network, and can be connected to the Internet through APs, wireless routers or wireless bridges; wireless instruments perform data collection and wireless transmission; wireless instruments and equipment are arranged on the work site The self-organizing network (Ad Hoc network) conducts mutual information transmission and remote wireless monitoring, reducing the trouble and inconvenience of wiring, which will greatly improve industrial production efficiency and facilitate people’s lives.

3 Hardware design of embedded wireless LAN module

This article uses Samsung S3C2410X as the embedded microprocessor, combined with wireless local area network technology, designed an embedded wireless local area network device to realize data collection and wireless transmission. The hardware structure diagram of the equipment is shown as in Fig. 2.

The application scheme of wireless LAN equipment based on S3C2410X embedded microprocessor
Figure 2: System hardware structure diagram

NAND FLASH is used to store startup programs, operating systems, TCP/IP protocol stacks, drivers and related applications. S3C2410X supports NAND FLASH Boot Loader. After the system is powered on, S3C2410X loads the boot code in NAND FLASH to its internal 4KB SRAM buffer called “Steppingstone” through the built-in NAND FLASH CONTROLLER to perform boot tasks without going through an external SDRAM. The system starts, thereby speeding up the startup process of the entire system. After the startup is completed, the operating system is run, and the code at this time and the subsequent application programs are all executed in the external SDRAM. After the operating system is started, you can execute the designed application program, collect data through the RS232/485 interface, and then transmit the data through the 802.11b wireless network card. All GPIOs of S3C2410X are drawn out for future expansion of system functions.

S3C2410X contains a memory management unit called MMU, which can realize the mapping from virtual storage space to physical storage space. Usually the program of the embedded system is stored in ROM/FLASH. The program can be saved after the system is powered off. However, compared with SDRAM, the speed of ROM/FLASH is much slower, and the abnormal interrupt vector table is usually stored in the embedded system. In RAM, the use of a memory mapping mechanism can solve this need.

NAND FLASH uses Samsung’s 64MB K9S1208VOM. It can program/erase 100,000 times and store data for up to 10 years. It is used to load operating system images and large-capacity data.

SDRAM is used to run the operating system and store the data needed during the running of the program. It uses Samsung’s K4S561632C, which is a 4M*16bit*4bank synchronous DRAM with a capacity of 32MB. Two pieces of K4S561632C are used to achieve bit expansion, so that the data bus width is 32bit.

S3C2410X comes with a USB master-slave interface, no special USB chip support is required, and USB data transfer can be performed as long as the driver is installed on it.

4 Software system design

The software system mainly includes the operating system, TCP/IP protocol transplantation, driver installation, and user application programming.

S3C2410X integrates a memory management unit, so more functions in the embedded operating system can be realized. In this article, Linux is adopted as the embedded operating system.

Linux is developed from UNIX. It inherits most of the advantages of UNIX and makes up for its shortcomings that are not suitable for running on a PC. The open kernel source code of Linux makes it the most popular operating system at present.

Linux is a true multi-user, multi-task, multi-platform operating system that can run on many hardware platforms. It has a hierarchical file system with built-in security measures, supports up to 32 file systems, and supports a large number of external devices.

The steps for customizing the operating system are as follows: (1) Compile the board-based support package BSP; (2) Cut and configure the various components of the operating system, and modify the corresponding configuration files; (3) Compile the kernel, components and BSP, and generate the operating system image File; (4) Download the image file to the target board for debugging.

There are several ways to download the operating system to the target board: download via BDM or JTAG interface, USB download, network interface download, serial port download, etc. The latter several methods must first download the corresponding monitoring program to Flash through the JTAG interface, and then the CPU starts from the Flash.

To implement the TCP/IP protocol under the support of the operating system, task division is required. The realization of TCP/IP can be divided into 4 tasks to achieve: ①IP task, mainly used to solve the reorganization of IP fragments; ②TCP input task, Mainly used to process the received TCP message segment; ③TCP output task, mainly used to package and send the data to be output; ④TCP timer task, mainly used to provide clock for various delay events (such as retransmission events). The relationship between them can be shown in Figure 3.

The application scheme of wireless LAN equipment based on S3C2410X embedded microprocessor
Figure 3 Task relationship

The USB driver design uses WDM (Winddows Drive Mode). The WDM device driver provides a frame of reference, which greatly reduces the difficulty of writing a driver by DDK.

The USB driver contains the following parts:

(1) Create equipment

The create device function is called with two parameters, one parameter is a pointer to the driver object, and the other parameter is a pointer to the physical device object.

(2) Turn off the equipment

(3) Read device data

When the customer should

When the program has a requirement to read the device data, the system will pass this requirement to the function driver in the form of IRP_MJ_READ IRP, which will be executed by the D12Meter_Read program of the device, and then D12Meter_Read will specify the USB bus driver to directly interact with the device.

(4) Write data to the device

When the client application has a requirement to write device data, the system will pass this requirement to the function driver in the form of IRP_MJ_WRITE and be executed by D12Meter_Write, and then D12Meter_Write will specify that the USB bus driver directly interacts with the device.

The USB driver recognizes the USB device through PID (product identification number) and VID (vendor identification number) in the installation file (.inf file).

Once the operating system is loaded, the driver of the wireless network card and other corresponding applications can be installed. Packing the wireless network card driver as a module into the operating system can avoid reinstalling the wireless network card driver every time the system is powered off.

User application programs are determined for specific application conditions, and are generally written in C language.

5 Summary

Embedded wireless local area network equipment can be used in occasions where the wired network cannot be extended or is difficult to install, and has requirements such as flexible mobility and temporary use. It can be used for data collection and wireless transmission, can be used for embedded handheld mobile terminals, can be used to build home wireless local area networks, and if a camera and image processing chip are added, it can also be used for remote wireless video monitoring in industrial sites.

The Links:   M190PW01 V6 G150XTN031

Random Posts