How to learn TCPIP (based on 51 single-chip)

xiaoxiao2021-03-06  48

Overall, TCPIP is not a very mysterious thing, especially based on MCU-based applications, and does not require special complex processing. Many cases only need to achieve the most basic functionality. Before achieving the MCU TCPIP transplant, you must have a certain degree of understanding of TCPIP. You can find a suitable book to flock, "TCP / IP detailed, volume 1: agreement" http://www.laogu.com/display .aspx? DID = 510 is a complete and detailed TCP / IP protocol guide. The various protocols belonging to each layer are described and how they run in different operating systems. For TCPIP applications on the MCU, it is not required to understand all parts of the protocol, the key points need to understand the relationship between the levels of TCPIP, the link layer, sometimes referred to as a data link layer or network interface layer, usually The device driver in the operating system and the corresponding network interface card in the computer. They process the details of the physical interface with the cable (or any other transport medium). The network layer is sometimes referred to as an internet layer, processing activities in the network, such as grouping selection. In the T C P / I P protocol, the network layer protocol includes the I P protocol (Internet protocol), I C M P protocol (I N t e R N e T Internet Control Packet Protocol), and I G M P Protocol (I N T E R N e t group management protocol). The transport layer is mainly providing end-to-end communication. In the T C P / I P protocol, there are two transport protocols mutually different: T C P (Transmission Control Protocol) and U D P (User Data News Agreement). T C P provides high reliability data communication for two hosts. It works to include the data to which the application is divided into the following network layers to confirm the received packet, and set the timeout clock that transmits the last confirmation packet. Since the transport layer provides high-reliability end-to-end communication, the application layer can ignore all of these details. On the other hand, U d p provides a very simple service for the application layer. It just sent packets called a datagram from one host to another, but does not guarantee that the data is allowed to reach the other end. Any necessary reliability must be provided by the application layer. These two transport layer protocols have different uses in different applications. The application layer is responsible for handling specific application details. Almost a variety of different T c P / I P implementation will provide Telnet, FTP, SMTP simple mail delivery protocol, SNMP Simple Network Management Protocol to these universal applications.

Various types of datagrams formats are also the need to understand. Using the Sniffer software can be very convenient to view the transceiver status of various datics newsletters on the computer. At the same time, Sniffer is also a very useful tool for debugging TCPIP protocols, using Sniffer The way can be easily searched on www.google.com. TCP / IP hierarchical, Ethernet package, IP head, subnet addressing, and subnet mask, ARP address resolution protocol, ICMP Control Packet Protocol Echo (Ping Program), UDP User Data News Agreement, TFTP Simple File Transfer Protocol, Especially TCP Transmission Control Protocol is a key knowledge necessary for TCPIP's application on the MCU. How to specifically understand the TCPIP, how to specifically The implementation has become the key to the problem. I use it in the process of learning TCPIP, using the TCPIP protocol village below, here there is a comparison and download address for 3 protocols. UIP, suitable for use on the 8BIT single-chip microcomputer However, the structure is more complicated, not suitable for transplantation, nor a code that is very suitable for reading. Downloads http://www.sics.se/~adam/uIP/ LWIP, suitable for use on the 16 / 32bit microcontroller, is embedded System developer's best learning TCPIP code, download address http://www.sics.se/~adam/lwip/ Zlip, a protocol farm prepared by Nankai University Electronic Application Laboratory, with the advantages of UIP and LWIP, Recommended beginners learn http://www.laogu.com/display.aspx?did=859 After understanding the specific implementation, there is a need to run on the MCU, here is the hardware circuit I have made, but Among them, I used the GAL16V8 chip to allocate address allocation, so I need to have a bunken that supports 16V8, and if the AT89C55 chip is replaced with SST89C58, download a Monitor 51 simulation monitoring program from www.sst.com Write the SST89C58 using the burner, you can use the serial port and Keil software to cooperate with the hardware simulation. (The market is more than the 51 emulator is this). The code of Gal is as follows (Abel HDL language) , What do you mean by using a guess? ! Module Chipsel Title 'Address To CS' U1 Device 'P16V8R'; A6, A7, A8, A9, A10 PIN 19, 1, 2, 3, 4 A11, A12, A13, A14, A15 PIN 5, 6, 7, 8 , 9; CSRAM, CS8019 PIN 18, 17; Addr = [A15, A14, A13, A12, A11, A10, A9, A8, A7, A6]; Equations CSRAM =! (AddR <^ H3FC); CS8019 =! Addr == ^ H3FC); End Chipsel; Download Compressed File Package: http://www.21icsearch.com/buzi/upimage/upfile/2005121959230.pdf (Download the suffix PDF to RAR, the JED file after extracting After compiling the target code, use Abel4 or Shuo ISP Lever 2.0 compile to open the downloaded ZLIP code, modify the #define RTL_BASE_ADDRESS 0XB000 to #define RTL_BASE_ADDRESS 0xFF00, compile, select MON51 for hardware emulation, open Sniffer, try ping, Can you connect?

转载请注明原文地址:https://www.9cbs.com/read-57667.html

New Post(0)