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.
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.
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.
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.
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.
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.
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
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Hiring embedded development engineers
- 19 "Ten Thousand Miles" Raspberry Pi Car——VSCode Learning (Multiple C File Link Debugging)
- What are the maskable interrupts of MSP430?
- I want a DAC+op amp circuit that can output about 15-30V.
- A 12-layer FPGA board drawn by KiCad
- Detailed description of how GaN devices can be used to design cost-effective 5G products
- 23 million Raspberry Pis have been sold
- Radio Frequency Tag (RFID) Static Electricity Control Solution
- Excellent materials: National undergraduate electronic design competition training course album
- LoRa Wireless Internet of Things wireless technology frequency band division