Tutorials to .com

Tutorials to .com » Mechine » Embed » ARM9-based embedded gateway Research

ARM9-based embedded gateway Research

Print View , by: iSee ,Total views: 20 ,Word Count: 2268 ,Date: Mon, 24 Aug 2009 Time: 4:04 AM

Introduction

Ubiquitous network access device to the network has brought enormous opportunities for development. With the rapid growth of Internet access market, embedded Internet access started to become embedded system technology, an area of greatest concern. In the embedded network technology will be driven by the formation of such a situation: The information transmitted on the network, there will be 70% of the information comes from embedded systems, and perhaps there will be hundreds of millions of vehicles, communications equipment, household appliances, as well as factory system access to different networks, and then formed a huge Internet Internet. To this end, this paper which is based on ARM chip and embedded operating system Linux, the Ethernet and RS -485 data exchange between the bus embedded gateway, embedded devices to meet the functional requirements of network .

Hardware platform design

The design of embedded gateway to ARM920T microprocessor core of the S3C2410, through external expansion memory, Ethernet port, serial port, JTAG debug interface, such as building a hardware platform, its hardware block diagram shown in Figure 1.

ARM9-based embedded gateway Research

CPU Design

CPU is the heart of embedded systems, real-time control, which in the industrial Ethernet as an intelligent node in the main controller, the core of the entire embedded gateway. This selection of the S3C2410 with ARM920T microprocessor core, S3C2410 is a 32bit RISC-microprocessors, the processors are especially suitable for handheld devices, as well as cost-effective, low-power network equipment, which integrates a LCD controller, USBHost, NAND controller, BUS controller, interrupt control, power control, storage control, UART, WatchDog, SPI, SDI / MMC, IS, IC, GPIO, RTC, TIMER / PWM, ADC and other rich resources.

Storage

Embedded systems can be customized according to need storage space. This paper extends two flash chips and a SDRAM. Flash chips are mainly a South Korean Hyundai 2MB16bit data width of the Flash chip HY29LV160B191 and a South Korean Samsung's 16MB of NANDFlash chip K9F2808UOB1571, SDRAM chips are used in a production of South Korea's Hyundai SDRAMHY57V5616201. 2MB of Flash chips HY29LV160B correspond The address space is mapped to address 0x00000000, as a storage boot configuration parameters and exception / interrupt vector table of the program space, a system reset after the read instruction from which the implementation of procedures; the use of South Korea's Hyundai's 8MB of SDRAMHY57V561620 as system memory, the corresponding address space mapped in the address Ox30000000 started to run as a program space and data space, startup code will copy the system image after the implementation of the SDRAM.

Serial section

Serial part of the design uses 2-way UART, which, all the way through the level conversion chip MAX232, the 3.3V logic level is converted to RS-232-C of the logic level for transmission to achieve ARM and the communication between the PC, , through the PC, HyperTerminal can be carried out on debugging; another way serial interface using the MAX1485 to level conversion from a RS-485 field bus to receive a message.

JTAG Debug Interface

In embedded systems, chip Shao Xie, commissioning need to use JTAG debug interface to meet the program to achieve real-time analysis and implementation monitoring. JTAG (Joint Test Action Group) is the IEEE specification standards, it can be through the existing JTAG boundary scan and ARMCPU cores to communicate a totally non-intrusive (do not take up on-chip resources), debug, it did not target memory, do not take up target system, any port, but these are the common presence of monitoring software are necessary. In addition, JTAG debug target program is executed on the target board, simulation, closer to the target hardware, the simulation results closer to the real operating environment, therefore, gradually become more of a debug mode use.

Ethernet

This Ethernet interface chips are used in RTL8019AS, 74LVC4245, FB2022 (NIC transformers). RTL8019AS is a cost-effective and with a full-duplex Ethernet controller plug and play functionality, its main features include: compliance with EtherNet Ⅱ with the IEEE802.3 standard; full-duplex, sending and receiving can simultaneously achieve the 10Mb / s rate of , built-in 16KB of SRAM, for the send and receive buffer, reduce the host processor requirements; support UTP, AUI, BNC automatically detect, but also supports 10BaseT topology auto-polarity correction; 4 diagnostic LED pins to allow programming output. RTL8019AS within the two RAM area, a 16KB, address 0x4000 ~ 0x7fff; 1 Kuai 32Byte, address 0x0000 ~ 0x001f. RAM press page is stored, each 256Byte as a. The program RAM will RTL8019AS the first 12 pages of (0x4000 ~ 0x4Bfff) as a send buffer; after 52 (0x4c00 ~ 0x7fff) as the receiving buffer; No. 0 only 32Byte, used to store the physical address of the Ethernet.

RTL8019AS chip pin SA0 ~ SA19 for the address bus; SD0 ~ SD15 for the data bus; S32C410-chip access pins INT0 external interrupt signal; pin is the address enable AEN feet, as a chip strobe, will break CPU-nGCS3 received address mapping to the bank3. RTL8019AS address space range is 0x18000300 ~ 0x1800031f. Pin IOS0 ~ 3 is set to ground, or idle, indicating that RTL8019AS bus address from the internal registers 300H start.

Pin X1, X2 then a passive 20MHz crystal, as an external clock signal input; pin JP then high, select jumper mode: pin IORB, IOWB read and write commands as input and output terminal; pin RSTDRV yes reset terminal, the connection reset signal; pin SMEMRB, SMEMWB is the chip memory read commands and write commands.

Pin TPIN +, TPIN-, TPOUT +, TPOUT-as media interface pin, is required to receive IP datagrams used pins in the design of the circuit chip card, through an isolation transformer and RJ-45 interface to the network, connected to the external host via Ethernet cable with RJ-45 interface to connect to achieve data exchange.

Isolation transformer TD + pin adapter to connect the chip TPOUT + pin; TD-connected TPOUT-; RD + link TPIN +; RD-connected TPIN-. 8019 through the isolation transformer and RJ-45 connection, to achieve with the host to receive and send IP datagrams and so on.

In addition, the hardware also includes the power supply circuit, crystal oscillator circuit, reset circuit, in this description is not 11.

Software part of the design

Embedded system software is divided into BootLoader part of the preparation, the operating system and file system migration, application of the preparation of three parts.

The preparation of BootLoader

BootLoader to run after the system power-paragraph 1 of the software code, that is, processor chips, the operating system before the implementation of the reset and entered a section of code, mainly for running the operating system to provide basic operating environment, such as CPU stack is initialized, initialization memory systems. BootLoader code core CPU chip, the structure, specific chips and operating system used and other factors related to its function is similar to PC-BIOS. BootLoader by running the program, you can initialize the memory and other hardware equipment, the establishment of memory space, maps, thus the system hardware and software environment into an appropriate state, for the final call to the operating system kernel ready for the right environment. Prepared by its general steps:

(1) mask all interrupts. To interrupt the provision of services is usually the operating system or device driver responsibility, therefore, the entire process of implementation of BootLoader can not respond to any interruption;

(2) Set interrupt vector;

(3) to set the memory control register;

(4) initialize the stack and registers. The system to initialize the stack depends on what interrupt users, and systems need to deal with what type of error, and definitions of several processors work. General manager stack must be set, if you use an IRQ interrupt, then the IRQ stack must also be set;

(5) If necessary, you need to change the processor mode, status;

(6) to initialize the memory space required for c language. For the correct application is running, the system needs should be read during the initialization of data and variables copied from ROM to RAM. Some require fast response programs, such as interrupt handlers need to run in the RAM; If you are using Flash, Flash, erase and write operations are also in the RAM to run the.

Embedded systems startup process is heavily dependent on the hardware, so the need to use assembly language to write. Complete the above steps, the system is complete operating environment for hardware and software initialization. Finally, the real-time operating system code read from the Flash memory space, began to run real-time operating system.

Operating system and file system migration

Linux as an excellent operating system, in recent years in the embedded field of a meteoric rise, has become the most promising embedded operating systems. Outstanding advantage is that a royalty-free and open source, while it can be applied to a variety of hardware platforms, has a good portability, high reliability, excellent networking capabilities and complete file system and a rich API, for embedded Gateway provides a powerful software support. Therefore, this paper select the operating system Linux as the embedded gateway. Transplantation for Linux has the following steps:

(1) download the Linux source code, the establishment of cross-compiler environment;

(2) configure and compile the kernel;

(3) Production of the file system, the preparation of the corresponding device driver;

(4) download, debugging and implementation of the kernel, and the file system, add your own applications.

The preparation of the application

In this paper, Socket socket and TCP / IP protocol to prepare a simple client / server model of network applications. Because this system is only to play the role of the gateway, just to achieve Fieldbus and Ethernet host computer for communication between the two parties do not need to deal with the logical meaning of their data and content. In this mode, the Ethernet host computer is set to server, it runs the server-side applications. The program is mainly used for listening server port to accept client connection requests, accept the client's information to the client to send information. Gateway system running the client program, which is mainly used for the application to connect to the server, you will fieldbus side sent a message to send to the server, processing the information sent by the server will be sent to the field bus information system. Application software flow shown in Figure 2.

ARM9-based embedded gateway Research

Software function call are:

(1) intsocket (intfamily, inttype, intprotocol). This function creates a port for communications, if a normal call will return an integer file descriptor, the error call will return -1.

(2) intbind (intsockfd, conststructsockaddr

* address, size-taddress-len). Once the Socket call this function successfully and returns a file descriptor, then the Socket server on this machine associated with a port, you can listen on the port service request. This function is used only for server-side program, the client need not call this function.

(3) intlisten (ints, intbacklog). The server is used to monitor whether the service request.

(4) intaccept (intsockfd, void * addr, int * addrlen). Ports of the service request. However, a client attempts to connect with the server listening port, the connection request will be waiting for the server to call this function to accept it.

(5) intsend (intsockfd, constvoid * msg, intlen, intflags); recv (intsockfd, void * buf, intlen, unsignedintflags). Send and receive data.

(6) intconnect (intsockfd, structsockaddr * serv-addr, intaddrlen). This function is used in conjunction with the remote server to establish a TCP connection.

(7) intclose (intsockfd). The end of data transmission.

Concluding remarks

This paper introduces the S3C2410 processor core, with RTL8019AS as a network interface chip embedded Ethernet interface, the specific hardware and software methods can be used for industrial field site nodes to achieve the automatic Internet access, in order to achieve on-site remote control, have a very a good development prospects.


Embedded Systems Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.