
Abstract: This paper describes the independent control chip based on the new CP2200 Ethernet communication interface hardware and software design.
Introduction
Currently, embedded designers for the remote control or monitoring equipment to provide Ethernet access, use the Ethernet controller is specifically designed for personal computer systems, such as the RTL8019, DM9008, CS8900A and so on. These devices interface circuit not only complex, bulky, and relatively expensive. CP2200 is Silabs recently launched a stand-alone Ethernet controller, it meets the IEEE 802.3 protocol to support the 10M Ethernet access, and requires only minimal external circuitry can meet the vast majority of embedded Ethernet connection Network interface design requirements, making the design of submerged Ethernet interface greatly simplifies greatly reduced board space, system development costs greatly reduced.
In addition, the Ethernet controller has an 8-bit parallel host interface, for the vast majority of micro-controller or host processor provides Ethernet communications. 8-bit parallel bus interface supports Intel and Motorola bus mode, you can use multiplexed or non-multiplexed addressing mode. These features together with associated processor TCP / IP protocol stack, making the embedded Ethernet applications has become extremely simple interface.
Hardware Design
The hardware circuit is shown in Figure 1. CP2200 external circuit is relatively simple.
Figure 1 hardware
I / O parallel interface
CP2200 parallel host interface, supports both Motorola and Intel bus mode, and address data to support reuse and non-multiplexed mode. MOTEN by the MUXEN and ground pins or pull high to achieve the host interface bus mode configuration.
Ethernet Transformer
To achieve the Ethernet interface, Ethernet transformer is indispensable. In the differential receiver pin (RX + / RX-), the need for a dedicated 1:1 10BASE-T operation pulse transformer. In the differential transmit pin (TX + / TX-), the need for external 1:2.5 with a center-tapped pulse transformer. Transformer voltage should be more than 2kV isolation in order to prevent static interference. Transmitter requires two 8W (accuracy of 1%) of the resistor and a 560pF capacitor connected with a particular side, the receiver requires a 100W resistor is connected with a particular client.
In accordance with the requirements of CP2200, the author uses a PRJ PRJ-010 series transformer. The transformer integrated RJ-45 connectors, save a lot of connections in the same time improve the reliability of high-frequency signal transmission.
Other circuits
LINK and ACT pin output level to drive the LED, to indicate the network connection and activity status.
All power pins must be connected with an external 3.3V power supply. Similarly, all references to the external connection should be connected to the same location. Each VDD and VSS pins should be connected to a 0.1mF ceramic bypass capacitor, the capacitor as close to the pin.
Need of special note is to drive twisted-pair interface requires relatively high current, the Ethernet transceiver cable should be as short as possible, and the wire to reduce resistive losses due to increase (in order to ensure reliable data transmission, the author's PCB circuit board chose to 20mil in diameter).
Software Design
TCP / IP protocol wide range of complex interactions between, the MCU can not be achieved on all protocols, it must be tailored to the protocol stack. Communication with the specific requirements of the system, the author retains the system eventually only TCP, UDP, IP, ICMP, ARP protocol modules. In the protocol stack on the overall design process, taking into account the implementation of single chip means a single task very difficult to play TCP / IP protocol features, we use event-driven mechanism based on TCP / IP protocol stack implementation. The introduction of the mechanism makes the system highly efficient in ensuring the efficiency of assembly language code at the same time, real-time responsiveness has also been greatly improved. The following describes the specific characteristics of event-driven mechanism and the mechanism based on TCP / IP protocol stack implementation.
Event-driven mechanism
After system initialization, enter the event loop, constantly check whether the queue of events C8051F040 event. Once the event queue is not empty, then read the word event flags to determine the type of event, and then call the corresponding event handling routine. Subroutine is finished, the remains back to the event loop body. Interrupt event flag word directly or indirectly by the driver, when an event occurs, the interrupt service routine will be just the corresponding bit in the status word. Constantly interrupted to add the event to the event queue, C8051F040 processor is constantly reading the event from the event queue flag word processing event.
Event-driven mechanism is characterized by:
* As the interrupt handler, the event marks only the implementation of a change in such a simple word program statement, the incident added to the C8051F040's event queue immediately after the return. So the system shut down interrupt a short time. Enhanced system for real-time interrupt handling.
* C8051F040 read based on the current events, the corresponding event handling, or add to the event queue of events required for further processing. This is actually carried out the tasks step by step processing, a step in the implementation of this task, but also can perform other tasks step. So. In the process does not affect the main case, but also improves the real-time system.