Talking about the Ethernet access scheme of single chip microcomputer

Source: Internet
Author: User

 A wide range of single-chip, from low to high-end, withWuyisingle-chip computer as the representative of8single-chip microcomputer andARMas the representative of +Single -chip microcomputer, different grades of single-chip microcomputer to achieve the different methods of network interface. For likeARMand other high-end processors can typically run embedded operating systems such as embeddedLinux. For non-operating system requirements of the microcontroller how to achieve network access, I will follow these scenarios according toTCP/IPthe different protocol stacks boil down to two main categories: the first is the traditional softwareTCP/IPprotocol stack Scheme; the second type is the latest hardwareTCP/IPprotocol stack scenarios. I will analyze the implementation of these two types of scenarios below.


1. Mac+phy Programme

the so-calledTCP/IPThe protocol stack is a generic term for a range of network protocols, including not only our well-knownTCPagreements andIPprotocol, and the network layer.ICMP(Internetcontrol Messages) protocol,IGMP(InternetGroup Management) protocol,ARP(Address Resolution) protocol, Transport layerUDP(user packet) protocol, application layerHTTP(Hyper-text transfer) protocol,DNS(Domain name resolution) protocol,FTP(File Transfer) protocol,SMTP(Simple Mail Management) protocol, and so on.

traditional Ethernet access schemes, such as mcu+mac+phy And then join the network interface to realize the physical connection of Ethernet, by implanting in the master chip TCP/IP Protocol code for communication and upper-level applications.

Figure 3-1-1 mac+phy Ethernet Solutions


apply this software protocol stack implementation of the more mature scheme has enc28j60 cs8900a dm9000 and of course there are like stm32f107 this type (internal with mac " +phy and so on.

        because the software stack operation requires a master control mcu constantly responding to interruptions, which largely takes up mcu operation / clock resources. After testing, a single-threaded operation, mcu The speed of operation and the processing speed of data can only meet the needs, but as the threads increase, mcu " Span style= "Color:rgb (0,0,0); Font-size:14px "> The efficiency of the linear decline, will seriously affect the quality of communication.

in terms of code volume, even with a lightweight TCP/IP protocol Stack LWIP the main chip will bring more than 40KB The amount of code, which is too heavy for a single-chip computer with low memory resources.

Again from the security point of view, the device must consider the network security issues after the integration of the Internet, this software protocol stack system once subjected to complex malicious attacks, the microcontroller is likely to be paralyzed, which is a fatal blow to the system, although the current network technology continues to evolve, all kinds of new encryption technology to make communications become more secure, But there are a variety of vulnerabilities.

2. Hardware protocol stack chip solution

      the hardware protocol stack chip scenario is shown. bymcu+Hardware protocol stack chip (includedMACand thePHYdirectly add the network interface, you can easily realize the single-chip computer networking, all the processingTCP/IPthe work of the agreement is through theMCUof the"Little Secretary"--hardware protocol stack chip to complete.

Figure 3-2-1 Hardware protocol stack chip solution

      &NBSP, wiznet first proposed and successfully launched the Ethernet series chip: w5100 w5200 w5300 w5500

The so-called hardware stack refers to the traditional software TCP/IP protocol stack with a hardware logic gate circuit to achieve, as shown in.

Figure 3-2-2 TCP/IP hardware protocol stack core schematic diagram


the core of the Ethernet chip is provided by the transport layerTCP,UDP,ICMP,IGMPprotocols, network layers, etc.IP,ARP,PPPoEprotocol, and the link layerMACcomposition, plus the physical layerPHYand peripheral registers, memory,SPIinterfaces make up this complete set of hardware-only Ethernet solutions.

This set of hardwareTCP/IPthe protocol stack replaces the previousMCUto handle these interrupt requests,thatMCUonly need to deal with user-oriented application layer data, Transport layer, network layer, link layer and physical layer all by the peripheryWIZnetchip to complete. This package simplifies the product development scenario by simplifying the five-tier network model described above from two aspects of hardware overhead and software development. As a result, engineers will no longer have to face the cumbersome communication protocol code, just need to understand the simple register function andSocketprogramming can complete the product development workdevelopment of network functionssection.

      Span style= "Color:rgb (0,0,0); Font-size:14px "> Thanks to the addition of the hardware stack, the microcontroller handles almost all of the TCP/IP Span style= "Color:rgb (0,0,0); Font-size:14px "> Work, not only greatly reduce the number of single-chip interrupts, so that the single-chip microcomputer frees up more resources to complete other work, and the hardware of the circuit processing protocol will be more rapid and stable. After testing, single-threaded, the communication speed of the scheme is the 10 socket Span style= "Color:rgb (0,0,0); Font-size:14px "" to communicate, so that the speed of communication is cumulative, and the single-chip microcomputer efficiency will remain high.

      Span style= "Color:rgb (0,0,0); Font-size:14px "> Because this package is mostly done on the socket" programming and the invocation of registers, so there is only 10k 51 stm32 And so the memory is very limited microcontroller is very suitable.

from a cost standpoint, the price of the hardware stack chip is roughly the same as that used by mac+phy . The former is easy to use and can complete the product development process in a short time. In addition, the official example libraries and the host computer program is rich, also shortens the test process, the latter basically is exempt from the maintenance.

Finally, the hardware logic gate circuit to deal with the TCP/IP protocol is not an attack, which means that the network attack and virus are not valid, which also makes up the short board of the network Protocol security insufficiency. It is precisely because of this advantage, the hardware stack technology in the future of the Internet of things and smart home area has a wide range of development prospects, so that people enjoy the joy of modern technology, while free from security problems.

Of course, the inevitable hardware stack is relatively lost in the flexibility of the software protocol stack. Currently, only 4 /8 socketsare supported and no more sockets can be opened at any one time . However, 8 sockets in embedded applications are sufficient to handle more than a large part of the application.

Talking about the Ethernet access scheme of single chip microcomputer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.