• Processes the platform by network protocol stack chip W3100A constitution TCP/IP

        Abstract: Introduced in detail one kind processor and the W3100A chip’s network processing platform’s design with realizes based on AT91M40800 the ARM7. After outlining the embedded network the prospect, proposed that one kind of TCP/IP network processing platform’s plan, and the multianalysis this kind of platform’s hardware module design, the software module design with realize.

        Key word: TCP/IP AT91M40800 network protocol stack chip W3100A

    Introduction

    More and more people the cognition after the PC time’s arrival, more and more embedded products had already arrived at the reality application onstage. The embedded product has been receiving and application close coupling this objective from the birth to prosperous. In the past they basically were the independent work, most was through 485, CAN main line and so on mutual exchange information; But along with information age’s information large explosion’s arrival, the market demand which these simple transmission interior few information’s plan already could not be able to realize satisfiedly very much, more and more embedded products had with the Internet interconnection, entered Internet this vast database the request. The embedded Internet technology is one kind turns on the embedded equipment Internet the technology. May extend using this technology Internet from PC machine to 8, 16, 32 monolithic integrated circuits, and realizes based on the Internet long range data gathering, the remote control, the auto-alarm, upload/downloading functions and so on data file, automatic transmission E-mail, expands the domain which greatly Intenrt the application scope and the embedded product touch. Therefore myself proposed that one kind network processing develops the platform based on W3100The core place TCP/IP the plan, and realizes.

    1 embedded network processing platform plan introduction

    At present, the domestic and foreign embedded network processing platform basically is uses the software to realize the TCP/IP agreement stack. This kind of plan when production in enormous quantities, has the cost low merit. Because of with software design’s TCP/IP agreement stack, is one time throws time uses many times; But this kind of plan development cycle comparison is long, is high to development personnel’s request, requests must have certain extent familiar to the operating system and the TCP/IP agreement, and upscale MCU and the RTOS price is also very high. Therefore myself proposed one kind realizes the plan directly using the TCP/IP agreement stack chip. It by W3100A, RTL8201, AT91M40800 is composed, as shown in Figure 1. This kind of plan, although in production in enormous quantities time the cost is high, because each intelligent equipment must insert the TCP/IP agreement stack chip; But in non-production in enormous quantities time has the design simply, the nimble characteristic, because does not need real-time operating system’s support, under the function storehouse support which and in myself gives each kind of tool which and the chip manufacturer provide to be possible to realize the major part function which on one kind of plan can realize.

    2 W3100A introductions

    W3100A is the TCP/IP agreement chip. It has the following characteristic: First, brings the TCP/IP agreement stack (for example TCP, UDP, Ipver.4, ICMP, ARP, DLC, the MAC agreement); Next, can simultaneously support four independent interface channels, has the high speed transmission speed, simultaneously, has with MCU and the physical level electric circuit connection. Although in the data book has only withdrawn Intel and Motorola MCU, but after author’s actual proof, W3100A to Atmel AT91M400800 can also the very good support. W3100A has also provided the Socket application procedure programming connection, needs to carry on the intelligent equipment which for that kind the Internet connects, has easily provided one kind easily, inexpensive, the highly effective plan. Its function diagram as shown in Figure 2.

    The W3100A register divides into four kinds:①With control register related order, condition and interrupt register;②Establishment gateway address, subnet mask, source IP address, source hardware address and overtime variable relational register;③The management transmits and receives the data the indicator register;④Controls channel register which each channel operates.

        W3100A 0X4000~0X5FFF is the transmission data buffer, this buffer can only write cannot read; 0X6000~0X7FFF is the receive data buffer, can only read cannot write.

    W3100A and MCU connection including direct main line pattern, non-direct main line pattern and I2C connection pattern. The 1st kind is 15 address wires is completely connected with MCU; So long as the 2nd kind 0, 1 two address wires and MCU are connected, 2, 3 address wires meet the high level, is left over the address wire earths completely; The 3rd way is treats as W3100The I2C equipment to use, 8~14 addresses use for to provide the I2C equipment’s address. Here has used the 2nd way and MCU is connected. And these pattern’s choice by MODE0, MODE1, the MODE2 three pin’s electric potentials decided.

    3 hardware circuit design

    Like Figure 1 law, this electric circuit mainly by based on ARM7 AT91M40800, W3100A, RTL8201 realizes the network function, but this system design’s goal is realizes embedded TCP/IP the network to develop the platform, with the aim of causing engineer to shift the energy from the massive first floor detail development to faces the application the stratification plane to come up, therefore outside the hardware circuit expanded interface circuits and so on SDRAM, Flash, LED, KEYBARD, RS232. And Flash, SDRAM, W3100A take CS0, CS1, the CS2 three address spaces separately. LED, KEYBARD altogether take a CS4 address space. SDRAM used 16 bit data line way, Flash, W3100A has used 8 bit data line way. AT91M40800 interface circuit as shown in Figure 3. SDRAM, Flash have provided the big surplus space, so that the future user will be able to develop own user program in above. And the Flash piece route selection is the NCS0,8 bit data main line width, the initialization routine locates its base address in 0×01000000, the address range is 0×01000000~0×011FFFFF. The system has used 2 piece of SDRAM, its piece of route selection is NCS1, uses SN74HC139D to carry on separately again selects patches or strips of land as worth saving for seed, the initialization routine locates its base address in 0×02000000, the address range is 0×02000000~0×02FFFFFF. Except for this, AT91M40800 also has the 8KB internal RAM,32 bit data main line width, after the initialization had ended, shoots again locates in 0×00000000.

    The W3100A piece route selection is the NCS3,8 bit data main line width, the initialization routine locates its base address in 0×0300000, its hardware connection as shown in Figure 4. Because has selected the second turning on method, only needs to four address register address, and the displacement quantity respectively is 0×0c, 0×0d, 0×0e, 0×0f, therefore its address range is 0×0300000C~0×0300000F. W3100A with advocates the MCU correspondence to use the interrupt mode, its INT pin receives AT91M40800 P9/IRQ0 the pin, realizes interrupts triggering. And W3100A and AT91M40800 carry on the replacement separately, with the aim of debugging separately.

    Figure 3

        Develops own application procedure for ease of the user in the platform, myself have realized the initialization and the debugging routine code above the platform. The system has provided two DB-9 plugs, connects AT91M40800 UART0 and UART1 separately: Uses in with author’s debugging routine realizing the correspondence, uses in the user other debugging application. Also used one on the system to dial the code switch, so that the user could carry out own application procedure and carries on the programming protection to Flash.

    And dials the code switch 1, 2 feet to meet, the low level high separately and is connected with at91M40800 P23 foot, after decides the MCU initialization, executive routine start address; 3rd, 4 feet meet the high level and at91M40800 NWR0/NWR pin separately, and writes with Flash enables the foot to be connected, decided that Flash is whether programmable.

    4 software module design

    In this system the software mainly includes three major parts: At91M40800 initialization code, monitor routine’s goal board and the PC platform realize, the Flash programming to realize.

    4.1 AT91M40800 initialization modules

    In this module, mainly take the goal board’s hardware design as a foundation, realizes the MCU register initialization, exceptionally to under meter’s initialization, the exception handler and each kind of processor pattern storehouse assignment and realizes shows again shoots. Then, gives the systems operation power the monitor routine or is user’s application procedure (by dials code switch to realize). And the register initialization already includes the ARM7 intranuclear register’s initialization, also includes inside and outside at91M40800 chip to encircle register’s initialization, concrete has R15, EBL_CS0, EBL_CS1, EBL_CS2, EBL_CS3, AIC_SVR0, PIO_IDR, PIO_PDR, US_CR and so on. Here code part is completely realizes with the ARM set of instructions. In order to increase the source program the readability, the probability, register’s address and data completely heavy definition naming, like addr_SVR8 EQU 0×0202000, CODE_SVR8 EQU 0×01010000, CODE_SVR8_END EQU 0×01011000.

    4.2 monitor routine realization

    The monitor routine may realize the following several functions: Demonstrated that under processor various conditions register’s value, the revision assigns the address in SDRAM, the FlashROM content, examined that assigns the address in memory’s content, downloads the user compilation’s code to the goal board refers to the non-periodical address in SDRAM, FlashROM, from assigns the address to start to carry out the user code, supports the user establishment the software interruption.

        Monitor routine including two parts: First, moves on the goal board procedure; second, moves in the PC machine on application procedure. On the goal board’s procedure realizes with on the PC machine procedure interactive operation, and defers to the PC machine procedure the instruction request to complete the read-write register, SDRAM, Flash and the execution assigns the address the code procedure. This section of codes are also realize with the ARM set of instructions, it is alternately the use assigns the ASCII code character with PC machine the way to realize. For instance, after pressing down PC machine on the Memory button, PC machine will transmit a V character, these information will transmit by the ASCII code’s way through the serial port to the target machine on. When on after the goal board’s monitor routine receives V character, skips immediately to the Memory marking section, responds OK in this section of procedures. After PC machine receives OK, the transmission address message, on after the goal board’s monitor routine receives the address, is following closely on the processing corresponding request. The PC machine end’s application procedure is uses the VB development environment to realize, its contact surface as shown in Figure 5. It provides to the user an interactive contact surface. Such development kit has not provided a simpler debug method to these expensive ARM simulator’s user.

    4.3 Flash programming realize

    The Flash programming takes an independent code part and the debugging routine code part joint operation, uses the C language to realize, and finally with first two partial chains department to together. It is mainly composed of following several parts: Flash programming module void Program(void); Cleans entire Flash chip Void EraseAll(void); Cleaning sector void EraseSector (void); Cleans sector int OneSectorErase (ulong targetAddr); The spatial byte inspects int BlankCheck (ulong targetAddr, ulong targetSize);Programming checking of solution int Verification (ulong targetAddr, ulong limit, ulong srcAddr); Waits for time delay int Wait (ulong tAddr). And the cleaning and the programming operation may complete using the AM291V160D instruction word. The spatial byte inspection is reads out in Flash the data, and obtains the result with the 0xFF comparison. The programming checking of solution is after the programming had ended transfers the function, it is through reads out the method which in the middle of Flash the data and the source data compare to realize, guaranteed that the programming result is correct. Because cleans operates and programs the operation to require certain time, to guarantee that cleans and program the stage which the operation the accuracy and judges them to locate, generally the Flash chip provides three judgment methods: First, application pin level way; second, uses the TOGGLE position the way; third, uses the POLLING position the way. Here in waits for in the time delay procedure to select the method which the TOGGLE position and overtime judgment position DQ5 unifies to realize the judgment cleaning programming operation concrete condition. The concrete judgment algorithm flow may refer to AM291V160D the data book.

    4.4 function storehouse support

    The user when develops own application procedure, but also two formidable function storehouse may use: One AT91M development storehouse which is Atmel Corporation provides (in Atmel Corporation’s main page may downloading), another the W3100A API function which is Wiznet Corporation provides (may in Wiznet Corporation’s main page downloading).

    Conclusion

    The user after using this system, may avoid to the massive real-time operating system and the first floor TCP/IP agreement detail understanding. The first floor software which, the tool and the chip manufacturer provides using myself provide the development storehouse, will be able nimble, to realize own embedded surfer plan and the application fast. This plan to speed up the user product going on the market to provide a rare platform.

    Share/Save/Bookmark

    Wednesday, October 15th, 2008 at 19:07
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3