Design of Ethernet interface circuit based on S3C2440 embedded system

Publisher:温馨小屋Latest update time:2018-02-12 Source: eefocusKeywords:S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    This paper mainly introduces an Ethernet interface circuit design scheme based on Samsung ARM9 chip S3C2440 embedded system, and successfully realizes the network data exchange of embedded system by using industrial Ethernet controller DM9000AEP. Based on the network interface circuit, the paper analyzes the driver and registry entries of DM9000AEP, the control software part of Windows CE system.

    With the development of microelectronics and computer technology, embedded technology has been widely developed and has become the development direction of modern industrial control, communication and consumer products. Ethernet's excellent performance in real-time operation, reliable transmission, unified standards, and its advantages such as easy installation, simple maintenance, and no communication distance restrictions have attracted wide attention from many researchers in the field of monitoring and control at home and abroad, and have shown significant advantages in practical applications. This paper proposes a design of Ethernet interface based on DM9000AE network interface chip and 32-bit Samsung ARM9 processor S3C2440 embedded system, and develops and transplants the network driver on the Windows CE operating system to achieve network access.

    2. DM9000AE working principle

    2.1 Main features and overall structure of DM9000

    DM9000AE is a 10/100M Fast Ethernet control chip developed by DEVICOM (Taiwan Lianjie International). DM9000AE implements the functions of Ethernet media access layer (MAC) and physical layer (PHY), including MAC data frame assembly/disassembly and transmission and reception, address recognition, CRC encoding/checking, MLT-3 encoder, receiving noise suppression, output pulse shaping, timeout retransmission, link integrity test, signal polarity detection and correction, etc. The internal logical structure of DM9000AE is shown in Figure 1.

    DM9000AE has the following main features: ①48-pin LQFP package, with few pins and small size; ②Support 8/16-bit data bus; ③Applicable to 10Base-T and 100Base-T, 10/100M adaptive, adapt to different network speed requirements; ④Built-in 16KB SRAM for sending and receiving buffers, reducing the speed requirements for the main processor; ⑤Support IP/TCP/UDP acceleration, reducing the CPU burden and increasing network speed; ⑥Support Back pressure half-duplex flow control, compatible with IEEE802.3u, support IEEE802.3x full-duplex flow control; ⑦20ns response time, 2.5V/3.3V low power consumption.

 

 1.jpg
Figure 1 DM9000AE internal logic structure

    2.2 Working Principle

    DM9000AE can be connected to the microprocessor in 8-bit or 16-bit bus mode, and can run in simplex or full-duplex mode as needed. When the system is powered on, the processor configures the DM9000AE internal network control register (NCR), interrupt register (ISR), etc. through the bus to complete the initialization of DM9000AE. Then DM9000A enters the data transmission and reception waiting state.

    When the processor wants to send a data frame to Ethernet, it first packages the data into a UDP or IP data packet and sends it byte by byte to the data transmission buffer of DM9000A through an 8-bit or 16-bit bus. It then fills the data length and other information into the corresponding register of DM9000AE, and then sends an enable command. DM9000AE will MAC frame the cached data and data frame information and send it out.

    When DM9000AE receives Ethernet data from an external network, it first checks the legitimacy of the data frame. If the frame header flag is incorrect or there is a CRC check error, the frame data is discarded. Otherwise, the data frame is cached in the internal RAM and the processor is notified through the interrupt flag. After receiving the interrupt, the processor processes the data received by DM9000AE in the RAM.

    DM9000AE automatically detects the network connection and sets the internal data transmission and reception rate to 10Mb/s or 100Mb/s according to the network speed. At the same time, DM9000AE can also change the direction of the data transmission and reception pins according to the RJ45 interface connection method, so no matter whether the external network cable is in peer-to-peer or cross mode, the system can communicate normally.

    3. Network interface hardware circuit design

    There are two common ways to add an Ethernet interface to an embedded system. The first method uses an embedded processor with an Ethernet interface. This method requires that the embedded processor has a universal network interface. Usually, this processor is designed for network applications, and the processor and network data are exchanged through an internal bus. The other method uses an embedded processor + network card chip structure. This method has no special requirements for the embedded processor, as long as the Ethernet chip is connected to the bus of the embedded processor. This method is highly versatile and is not limited by the processor. However, the processor and network data exchange data through an external bus [3].

    This design adopts the second method of extending the Ethernet interface on the general embedded microprocessor S3C2440. The structure of the connection between the S3C2440A processor and the DM9000AE is shown in Figure 2. The DM9000AE is connected to the processor through the bus, and the interrupt is connected to the external interrupt of the processor.

2.jpg
Figure 2 Structure of the connection between S3C2440A processor and DM9000AE

   

    The S3C2440A microprocessor is a low-power, highly integrated 16/32-bit RISC microprocessor designed by Samsung Semiconductor for handheld devices and various multi-purpose applications. It uses a five-stage pipeline and Harvard structure and is packaged in a 289-pin FBGA package. The S3C2440 not only includes the ARM920T core, but also adds a wealth of peripheral resources, including 1 LCD controller; 3-channel UART; 4-channel DMA; 4 16-bit timers/counters with PWM function and 1 16-bit internal timer, supporting external clock source; 8-channel 10-bit ADC; touch screen, IIC bus, IIS bus, SD card and MMC card, camera interface; 130-bit general I/O port and 24-bit external interrupt source.

    The connection of the DM9000AE Ethernet interface circuit is shown in Figure 3. The processor uses the chip select DM_CS and the address line BADDR to connect the CS pin and CMD pin of the DM9000AE chip respectively, and the data line BDATA[15:0] of the S3C2440 is connected to the data line SD[15:0] of the DM9000AE to realize the data transmission between the DM9000 and the S3C2440; the DM_IOR pin of the S3C2440 is connected to the read pin IOR# of the DM9000AE, and the DM_IOW pin is connected to the write pin IOW# of the DM9000AE; at the same time, the DM9000AE occupies the interrupt pin EINT7 of the S3C2440, so that the S3C2440 can respond to the interrupt of the DM9000AE. The connection between the DM9000AE and the network is connected to the Ethernet crystal connector RJ_45 by the receiving signal line RX+, RX- and the sending signal line TX+, TX- through the isolation transformer E-2023. The main function of the isolation transformer is to isolate the embedded system from the external circuit, prevent interference and burn out of components, and realize the live plug-in and pull-out function.

3.jpg
Figure 3 Ethernet interface circuit

    4. Software design of network interface module

    This system uses Windows CE operating system, which has powerful network support functions. Windows CE supports all Internet network protocols including TCP/IP. Windows CE network drivers all follow NDIS (Network Driver Interface Specification). NDIS provides two abstract layers to connect network drivers and protocol stacks. The schematic diagram of NDIS model is shown in Figure 4.

4.jpg

Figure 4 Schematic diagram of the NDIS model

      The driver of DM9000AE under Windows  CE is written based on this model, compiled into a dynamic link library, and exists in the form of a DLL file in user mode. The entry function is DriverEntry(). The workflow of DM9000 driver is shown in Figure 5.


    The function of NdisMInitializeWrapper() is to notify NDIS that a miniport network card is being initialized. This function is provided in ndis.dll. Then the NDIS40_MINIPORT_CHARACTERISTICS structure variable is initialized, mainly setting some callback functions (MiniportInitialize(), MiniportReset(), MiniportInterruptHandler(), MiniportISRHandler(), MiniportQueryInformation(), MiniportSetInformation(), MiniportSend()). Then the NDIS40_MINIPORT_CHARACTERISTICS structure is used to register with the NDIS system through the NdisMRegisterMiniport() function. The next step is MiniportInitialize(), which contains the initialization of the NIC_DRIVER_OBJECT class and the call of the EDriverInitialize() function of the class. In this function, all the initialization operations of dm9000 are fully carried out.

    All initialization operations of DM9000 are implemented in the dm9000.cpp file, mainly through the DeviceEntry() function. In the DeviceEntry() function, only one thing is done: a new instance of the C_DM9000 class is created and returned. Then the C_DM9000 instance performs a series of initialization operations on the DM9000AE through DeviceSetDefaultSettings(); DeviceSetEepromFormat(); DeviceRetriveConfigurations(hconfig); EDeviceValidateConfigurations(), etc. Then NIC_DRIVER_OBJECT points to DriverStart(). In DriverStart(), C_DM9000 only performs a very simple but most important operation, which is to start the interrupt in DeviceEnableInterrupt(). The next step is endless waiting, receiving, and sending, and DM9000 starts working.5.jpg

Figure 5 DM9000 driver workflow

      After completing the driver, we also need to set the DM9000 registry entries in the Platform.reg file accordingly:

    [HKEY_ LOC AL_MACHINECommDM9000]

    "DisplayName"="Crystal DM9000  ISA  Ethernet Controller"

    "Group"="NDIS"

    "ImagePath"="DM9000.DLL"

    [HKEY_LOCAL_MACHINECommDM9000Linkage]

    "Route"=multi_sz:"DM90001"

    [HKEY_LOCAL_MACHINECommDM90001Parms]

    "BusNumber"=dword:0

    "BusType"=dword:0

    "InterruptNumber"=dword:3E

    "IoBaseAddress"=dword:D3000000

    "RxMode"="PIO"

    "NetworkAddress"="00-01-33-33-33-33"

    [HKEY_LOCAL_MACHINECommDM90001ParmsTcpIp]

    "Enab LED HCP"=dword:0

    "DefaultGateway"="192.168.126.1"

    "UseZeroBroadcast"=dword:0

    "IpAddress"="192.168.126.100"

    "Subnetmask"="255.255.255.0"

    "DNS"="192.168.126.1"

    [HKEY_LOCAL_MACHINECommTcpipLinkage]

    "Bind"=multi_sz: "ppp", "DM90001"

    Connect the designed module to the local area network, assign MAC address and IP address, use the PC's PIN g program to get a response, indicating that the ARP, IP, and ICMP protocols are normal. Use the windows-based application you wrote to send a connection request to the module, and the module returns the correct response information, indicating that the TCP protocol is normal.

    5. Conclusion

    This article introduces in detail the network interface design scheme based on Samsung's ARM9 chip S3C2440 embedded system. In practical applications, the system runs stably and can easily realize the network interconnection of embedded systems. Due to the use of high-performance industrial Ethernet controller DM9000AE, the system communication is fast and reliable, with high real-time performance. With the increasing popularity of Ethernet, this solution can be used to intelligently transform traditional embedded devices that do not have network communication capabilities. It is also suitable for the development of new intelligent instruments and industrial automation system equipment, and has broad application prospects.


Keywords:S3C2440 Reference address:Design of Ethernet interface circuit based on S3C2440 embedded system

Previous article:TinyOS transplantation method based on STM32 and CC2520
Next article:Design of Network Storage NAS System

Recommended ReadingLatest update time:2024-11-23 07:16

s3c2440 serial port programming
0. Serial bus standard: RS-232C RS-422A RS-485 1. Serial communication is divided into synchronous communication and asynchronous communication. We usually use asynchronous serial communication. When communicating, both parties first agree on the format of the data frame, that is, the baud rate, data bits, stop bits
[Microcontroller]
s3c2440 serial port programming
ARM9 S3C2440 - Initialization configuration of interrupts and timers
      ARM9  S3C2440 has a lot of registers, which is one of the differences between it and single-chip microcomputer. ARM programming is mainly about register operations, but with so many registers, it is easy to forget the setting of a certain register. If you can summarize the steps of register configuration so that
[Microcontroller]
s3c2440 bare metal-resistive touch screen programming (1. Resistive touch screen principle)
1. Principle of resistive touch screen The touch screen contains two transparent layers stacked up and down, generally covering the LCD surface. The two transparent layers are composed of uniform resistive media, as shown in the figure below. When the pressure on the touch screen surface (such as pressing by a pen t
[Microcontroller]
s3c2440 bare metal-resistive touch screen programming (1. Resistive touch screen principle)
Section 002_S3C2440_LCD Controller
LCD controller main functions and required settings: Get: Get the data of a certain pixel from the memory (FrameBuffer); then tell the LCD controller the FrameBuffer address, BPP, and resolution; Send: send FrameBuffer data to LCD in conjunction with other signals; need to set LCD controller timing and pin polarity;
[Microcontroller]
Section 002_S3C2440_LCD Controller
S3C2440 needs to burn bare metal applet to NAND Flash
For Wei Dongshan's S3C2440 development board, when running simple small programs such as LED, it must be burned to NAND Flash for the following reasons: (1) Although NOR Flash can be read like RAM, it cannot be written like RAM. Therefore, if you want to boot from NOR Flash, you usually use assembly instructions at th
[Microcontroller]
Porting Linux-3.4.2 kernel to S3C2440
1. BootLoader boot kernel process 1. Bootloader Work 1.1. Read the kernel into memory 1.2. Save the kernel startup parameters to the specified location, and parse the parameters at this location when the kernel starts 1.3. Start the kernel and pass in the machine ID 2. Kernel startup proce
[Microcontroller]
Detailed explanation of S3C2440 cp15 coprocessor
The 2440 coprocessor CP15 has a total of 16 coprocessor registers from c0 to c15, each with a certain function definition. But in general, cp15 is mainly related to the following functions: 1. Get some CPU related information such as device id and cache type. 2. MMU operation. Including enabling and disabling the MMU,
[Microcontroller]
Detailed explanation of S3C2440 cp15 coprocessor
Energy dispersive X-ray fluorescence spectrometer based on S3C2440
X-ray fluorescence analysis is a fast, accurate and economical multi-element analysis method . At present, X-ray fluorescence analysis technology has been widely used in geology, metallurgy, chemical industry, materials, petroleum, medicine and other fields, especially energy dispersive X-ray fluorescence (EDXRF) sp
[Microcontroller]
Latest Microcontroller Articles
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号