Design of Ethernet Interface for S3C2440 Embedded System Based on DM9000AE

Publisher:平稳心绪Latest update time:2012-12-11 Source: 21ic Keywords:DM9000AE  S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

本文介绍了一个基于三星ARM9芯片S3C2440嵌入式系统的以太网接口电路设计方案,采用了工业级以太网控制器DM9000AEP成功实现了嵌入式系统网络数据交换。论文在重点阐述了网络接口电路基础之上,对Windows CE系统控制软件部分DM9000AEP的驱动程序和注册表项进行了具体分析。

随着微电子技术和计算机技术的发展,嵌入式技术得到广阔的发展,已成为现代工业控制、通信类和消费类产品发展的方向。以太网在实时操作、可靠传输、标准统一等方面的卓越性能及其便于安装、维护简单、不受通信距离限制等优点,已经被国内外很多监控、控制领域的研究人员广泛关注,并在实际应用中展露出显著的优势。本文提出了一种基于DM9000AE网络接口芯片和32位三星ARM9处理器S3C2440嵌入式系统的以太网接口的设计方案,并在Windows CE操作系统上开发移植了网络驱动程序实现网络的接入。

2. DM9000AE工作原理
2.1 DM9000的主要特性和总体结构

DM9000AE是DEVICOM(台湾联杰国际)研发的一款10/100M快速以太网控制芯片。DM9000AE实现以太网媒体介质访问层(MAC)和物理层( PHY)的功能,包括MAC数据帧的组装/拆分与收发、地址识别、CRC编码/校验、MLT-3编码器、接收噪声抑制、输出脉冲成形、超时重传、链路完整性测试、信号极性检测与纠正等。DM9000AE内部逻辑结构如图1所示。

DM9000AE具有以下主要性能:①48管脚的LQFP封装,管脚少体积小;②支持8/16位数据总线;③适用于10Base-T和100Base-T,10/100M自适应,适应不同的网络速度要求,④内置16KB的SRAM,用于收发缓冲,降低对主处理器的速度要求;⑤支持IP /TCP /UDP加速,减轻了CPU负担,提高网络速度;⑥支持Back pressure半双工流量控制,与IEEE802.3u兼容,支持IEEE802.3x全双工流量控制;⑦20ns响应时间,2.5V/3.3V低功耗。

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 internal network control register (NCR) and interrupt register (ISR) of DM9000AE 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 UDP or IP data packets and sends them byte by byte to the data transmission buffer of DM9000A through the 8-bit or 16-bit bus, and then fills the data length and other information into the corresponding register of DM9000AE, and then sends the enable command. DM9000AE frames the cached data and data frame information into MAC and sends them out.

When DM9000AE receives Ethernet data from the 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 status and sets the internal data transmission and reception rate to 10Mb/s or 100 Mb/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 whether the external network cable is in peer-to-peer or cross mode, the system can communicate normally.

3. Network interface hardware circuit design

Adding an Ethernet interface to an embedded system is usually implemented by the following two methods. 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 realizes the exchange of processor and network data through the internal bus method. The other method uses an embedded processor + network card chip structure. This method has no special requirements for the embedded processor. It only needs to connect the Ethernet chip to the bus of the embedded processor. This method is highly versatile and is not limited by the processor. However, the processor and the network exchange data through the external bus [3].

This design adopts the method of extending the Ethernet interface on the universal embedded microprocessor S3C2440, that is, the second method. 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 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 through the isolation transformer E-2023 via the receiving signal line RX+, RX- and the sending signal line TX+, TX-. 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. [page]

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 initialize the NDIS40_MINIPORT_CHARACTERISTICS structure variable, mainly setting some callback functions (MiniportInitialize(), MiniportReset(), MiniportInterruptHandler(), MiniportISRHandler(), MiniportQueryInformation(), MiniportSetInformation(), MiniportSend(). Then register with the NDIS system using the NDIS40_MINIPORT_CHARACTERISTICS structure through the NdisMRegisterMiniport() function. Next is MiniportInitialize(), which initializes the NIC_DRIVER_OBJECT class and calls the EDriverInitialize() function of the class. In this function, all initialization operations of dm9000 are fully launched

. All initialization operations 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


在完成了驱动程序之后,我们还需要在Platform.reg文件中对DM9000的注册表项进行相应的设置:

[HKEY_LOCAL_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]
"EnableDHCP"=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"

将设计的模块与本地局域网连通,并分配MAC地址和IP地址,利用PC的ping程序,得到回应,说明ARP、IP、ICMP协议正常。利用自己编写的基于windows的应用程序,向模块发送连接请求,模块返回正确的应答信息,TCP协议正常。

5.结束语

本文详细介绍了基于三星公司ARM9芯片S3C2440嵌入式系统的网络接口设计方案,在实际应用中该系统运行稳定,能够十分方便地实现嵌入式系统的网络互连。由于采用了高性能的工业级以太网控制器DM9000AE,系统通讯快速可靠,具有很高的实时性。在以太网日益普及的今天,此方案能够给那些传统不具备网络通讯能力的嵌入式设备进行智能化改造,也适用于新型智能仪器仪表和工业自动化系统设备的开发,有着广泛的应用前景。

Keywords:DM9000AE  S3C2440 Reference address:Design of Ethernet Interface for S3C2440 Embedded System Based on DM9000AE

Previous article:TinyOS transplantation and driver analysis for STM32 and CC2520
Next article:STM32's strip fingerprint collection and splicing system

Recommended ReadingLatest update time:2024-11-16 16:37

11-S3C2440 driver learning (VIII) Embedded Linux-block device driver
1. Review of character device drivers Mainly divided into simple character device drivers and complex character device drivers 1. Simple character device driver For simple character device drivers, there is no need to adopt the idea of ​​separation and layering, which mainly includes the following parts. 2. Complex
[Microcontroller]
11-S3C2440 driver learning (VIII) Embedded Linux-block device driver
s3c2440 bare metal development and debugging environment (MDK4.72, Jlink v8, mini2440)
My development environment: Windows 7 32-bit, J-linkv8, a mini2440 development board. Finally, I chose: MDK4.72 version, the latest version of J-ink v8, J-linkARM v4.94. 1) Open Keil uVision4 and create a new project: 2) Create a new directory to store our project files, so I create a new test
[Microcontroller]
s3c2440 bare metal development and debugging environment (MDK4.72, Jlink v8, mini2440)
S3C2440—3. Use LED lighting to get familiar with the detailed process of bare metal development
Lighting up the LED with bare metal can be divided into three steps: Look at the schematic diagram and determine the pins that control the LED Look at the chip manual to determine how to set/control the pins Writing a Driver 1. Hardware knowledge 1.LED schematic diagram The schematic abstracts the LED like thi
[Microcontroller]
S3C2440—3. Use LED lighting to get familiar with the detailed process of bare metal development
04-S3C2440u-boot learning u-boot analysis (1) compilation experience
U-Boot, the full name of Universal Boot Loader, is an open source project that complies with the terms of the GPL. The function of U-Boot is to boot the system. U-Boot has evolved from FADSROM, 8xxROM, and PPCBOOT. Its source code directory and compilation format are very similar to the Linux kernel. In fact, many U
[Microcontroller]
04-S3C2440u-boot learning u-boot analysis (1) compilation experience
S3C2440-IIS sound output
The Inter-IC Sound (IIS) bus interface of S3C2440A is used as a codec interface to connect external 8/16-bit stereo audio decoder IC for mini disc player and portable applications. The IIS bus interface supports IIS bus data format and MSB-justified data format. The interface uses DMA mode to access FIFO instead of int
[Microcontroller]
Learn S3C2440 bare metal development under Keil from 0 - 1 Using internal RAM
1 Establish KEIL development environment Keil version: μVision V4.71.2.0; Debugger: JLINKV8; Debug software: J-Link ARM V4.72. 2 New Construction Create a new project as shown in Figure 1, and create a folder structure on the hard disk as shown in Figure 2. After saving, select the CPU type as shown in Figure 3
[Microcontroller]
Learn S3C2440 bare metal development under Keil from 0 - 1 Using internal RAM
The whole process of porting SD/MMC to S3C2440 under linux-2.6.24.3
1. First download the 2.6.24.3 kernel source code. Other kernels are not guaranteed to work. I won't talk about the porting part. If you don't know how to do it, please refer to my other articles. I only tested this one. 2. Go to http://svnweb.openmoko.org/*check ... _mci.patch?rev=4096 to download the S
[Microcontroller]
S3C2440 bare metal -------I2C_S3C2440 I2C controller control timing
1. Register The I2C of S3C2440 is mainly controlled by the following four registers.  2. Data transmission process  
[Microcontroller]
S3C2440 bare metal -------I2C_S3C2440 I2C controller control timing
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号