W5500 Ethernet module introduction

W5500 Ethernet module

The W5500 Ethernet module is a module that uses the hardware TCP/IP protocol stack chip W5500 as the main control to debug the transmission signals on the Ethernet and convert the signals into valid data that can be recognized and processed by the CPU. It has excellent performance and good cost performance.

  • W5500 is an embedded Ethernet controller with a full hardware TCP/IP protocol stack, which enables the embedded system to be easily connected to the network through the SPI (Serial Peripheral Interface) interface. The system provides an easier Internet connection solution.
  • The W5500 Ethernet module has a complete TCP/IP protocol stack and supports TCP, UDP, IPV4, ICMP, ARP, IGMP and PPPOE protocols. 10/100Mbps W5500 Ethernet data link layer (MAC) and physical layer (PHY), enabling users to use a single chip to expand network connections in their applications, so W5500 Ethernet module is especially suitable for those who need to use a single-chip computer to achieve Internet function client.
  • The W5500 Ethernet module uses 32KB cache as its data communication memory for Ethernet processing. By using Ethernet module W5500 users only need to use a simple socket program to implement Ethernet applications, and no longer need to deal with a complex Ethernet controller. This will be faster and easier than other embedded Ethernet solutions.
  • The W5500 Ethernet module can use 8 hardware Sockets for independent communication at the same time, so that the main control chip of the upper computer only needs to undertake the processing task of the control information of the TCP/IP application layer, thus greatly saving the data copying, protocol processing and interrupt processing of the upper computer. In terms of workload, the system utilization rate and reliability are improved.
  • The W5500 Ethernet module provides SPI (Serial Peripheral Interface) for easier integration with peripheral MCUs. Moreover, Ethernet module W5500 supports SPI communication rate up to 80MHZ, which can better realize high-speed network communication. In order to reduce system power consumption, W5500 Ethernet network module provides wake-on-lane mode (WOL) and sleep mode for customers to choose to use. W5500 Ethernet network module will wake up when it receives a magic packet in the form of an original Ethernet packet.
  • The W5500 Ethernet module also supports 3.3V or 5V power supply, and can output 3.3V voltage when the 5V power supply is used, which is convenient for users to use in different microcontroller systems.
  • The communication mode between the W5500 Ethernet module and the MCU system is simple and convenient SPI bus communication.

Notes: Ethernet is a networking technology that connects computers by wire. It is the medium of direct connection between the computer and the Internet via a USB cable or an Ethernet cable. Communication between devices is possible via Ethernet.

W5500 Ethernet Module Datasheet

W5500 Ethernet Module Features

  • 3.3V power supply 3.3VTTL level
  • Support baud rate range: 1200~115200bps;
  • Support None, Odd, Even three kinds of verification;
  • 10M/100M Ethernet interface;
  • Support 802.3 standard Ethernet communication protocol;
  • Support multiple network protocols: TCP/UDP/configuration software/modbus RTU;
  • Working mode: TCP Server, TCPClient, UDPServer, UDPClient;
  • Adopt high-performance 32-bit processor;
  • Support serial AT command mode configuration, web page configuration and host computer tool configuration;
  • Support serial port package parameter design;
  • Virtual serial port driver under Windows NT/2000/XP/Vista/Win7 platform;

W5500 Ethernet Module Schematic

w5500 ethernet module schematic

W5500 Ethernet module pin header function table

Pin identificationFunction Description
3.3V3.3V power input pin
MISOSPI master input slave output pin
MOSISPI master output slave input pin
SCSSPI SLAVE select pin (active low)
SCLKSPI clock pin
5V5V power input pin
GNDpower ground pin
RSTW5500 Ethernet hardware initialization pin (active low)
INTW5500 Ethernet interrupt pin (active low)
NCNo Connection

W5500 Ethernet module and STM32F103 development board connection method

W5500 Ethernet module and STM32103 development board network communication line connection method:

STM32F103 W5500 pin connection instructions

W5500 Ethernet moduleW5500 Ethernet moduleW5500 Ethernet moduleSTM32F103VET6 development board
Pin no.Pin namePin descriptionPin name
1CSchip select pinPB12
2CLKSPI clockPB13
3MISOmaster input slave outputPB14
4MOSImaster output slave inputPB15
5INTinterrupt pinPC6
6RSTreset pinPB7
123V3Power supply 3.3V3V3

The stm32f103 development board is paired with the W5500 Ethernet network adapter board to achieve wired network access, and provides application routines to help you better understand the Ethernet hardware protocol stack chip W5500, and how to easily implement various common application protocols through STM32 W5500.

We choose the SPI1 interface of the STM32 development board to connect with the W5500 Ethernet module network adapter board. The SPI1 interface circuit diagram of the development board is shown in the figure.

Among them, pins 1, 2, 3, and 4 correspond to the SCSN, SCLK, MOSI, and MISO 4-way signals of the network adapter board of the W5500 Ethernet. Pin 5 corresponds to the interrupt pin of W5500. If you want to realize the networking function through interrupt, you need to define this pin. Pin 6 corresponds to the system reset pin of the W5500 Ethernet module pdf. Pins 7, 8, and 9 have not been used yet, so the hardware design of the SPI Ethernet module w5500 is empty, and pins 10 and 12 are power supply pins for the W5500 Ethernet module.

W5500 Ethernet module has two working modes, variable data length mode and fixed data length mode. In variable data length mode, SPI Ethernet module w5500 can share the SPI interface with other SPI devices. But once the SPI interface is assigned to W5500, that is, if the 1-pin CS chip select signal selects this W5500 Ethernet, it can no longer be shared with other SPI devices. In fixed data length mode, SPI will be assigned to W5500 Ethernet and cannot be shared with other SPI devices. Because the 1-pin CS chip select signal will be grounded directly to low level.

The initialization process of the W5500 Ethernet module mainly uses the following functions:

  • W5500_conf.c mainly configures the MAC and IP address of W5500 Ethernet module , the basic data read and write process of W5500 Ethernet module , reset setting function, etc.
  • The Socket.c function mainly introduces the SOCKET-related configuration functions of W5500 Ethernet module , such as opening and closing of SOCKET, receiving data, sending data, etc.
  • The Utility.c function mainly introduces the basic delay function and data format conversion function.
  • W5500.c mainly introduces the register read and write process of W5500 Ethernet module

The W5500 Ethernet module can be connected not only with the stm32f103 development board(STM32F103 W5500), but also with any STM32 development board, such as: STM32F407 development board (STM32F407 W5500), stm32f429 development board (STM32F429 W5500), etc. As long as it is a development board sold by our company, the network function can be realized through the development board. If you want to know more information, welcome to contact us.

Wiring method of W5500 Ethernet module and STC51 development board 

Wiring method ofW5500 Ethernet module and STC51 development board

P3^2 -> W5500_RST

P3^3 -> W5500_INT (When the 51 routine is in the query register mode, this pin can be left unconnected)

P3^6 -> W5500_SCS

P3^7 -> W5500_SCK

P3^4 -> W5500_MISO

P3^5 -> W5500_MOSI

Wiring method between W5500 Ethernet module and router (or computer network port)   

Network cable connection method:

Method 1: One end of the network cable is connected to the W5500 Ethernet module, and the other end is connected to the router (recommended, this method is relatively simple)

Method 2: One end of the network cable is connected to the W5500 Ethernet module, and the other end is connected to the computer network port (relatively more complicated)

Note: The routine of querying the register means: when the port of the W5500 Ethernet module is successfully connected to the computer, the connection is interrupted, the connection times out, the data is received, the data is sent, etc., when the state transmission changes, etc., the corresponding port can be checked in the program. At this time, the interrupt pin of the W5500 Ethernet can be disconnected; the interrupt mode program means that when the above state changes, the interrupt pin will be pulled low, and an interrupt will occur in the program. At this time, the interrupt pin must be connected . Users can use the above two methods according to their own habits. The test methods of the following client, server and UDP modules have nothing to do with the program of query or interrupt mode, whichever one can be used by the user.

W5500 Ethernet module example code

Experimental phenomena

Open the ping routine, find the w5500_conf.c file, set the remote IP in line 13 to the IP of your host, download it after compiling, and open the serial port assistant to see the debugging information. For more introduction and information about the W5500 Ethernet module example code , please contact us.

W5500 Ethernet module example code

The “Ethernet header” contains some description items of the data frame, such as the sender, receiver, data type, etc.; the “data” part is the specific content of the data; the “Ethernet tail” is the CRC check code. The length of the “Ethernet header” is fixed at 14 bytes. The length of “data”, the shortest is 46 bytes, the longest is 1500 bytes. The length of the “Ethernet trailer” is fixed at 4 bytes. Therefore, the entire “frame” can be as short as 64 bytes and as long as 1518 bytes. If the data is very long, it must be divided into multiple frames for transmission.

W5500 Ethernet module mac address

As mentioned above, the “header” of the Ethernet data frame contains information about the sender and receiver. So, how are the sender and receiver identified?

The data link layer is actually composed of two independent parts, media access control (Media Access Control, MAC) and logical link control layer (Logical Link Control, LLC). MAC describes how stations are scheduled, generated and received in a shared medium environment. The MAC ensures the reliable transfer of information across links, synchronizes data transfers, identifies errors and controls the flow of data. Generally speaking, MAC is only important in a shared medium environment, only in shared medium environment, multiple nodes can be connected to the same transmission medium. IEEE MAC rules define addresses, that is, MAC addresses, to identify multiple devices in a data link, so the link layer is also called “MAC layer”.

When each network card leaves the factory, it has a unique MAC address in the world, the length is 48 binary bits, usually represented by 12 hexadecimal numbers.

W5500 Ethernet module mac address

The first 6 hexadecimal numbers  of W5500 Ethernet module mac address are the manufacturer’s serial number, and the last 6 are the serial number of the network card of the manufacturer. With the MAC address, the network card and the path of the data packet can be located.

W5500 Ethernet Module  Testing

The W5500 Ethernet Module and the STM32 development board form an Internet hardware platform. After downloading the control program to the microcontroller, it can be tested on each platform.

W5500 ethernet module test scenario 1: STM32 development board + W5500 ethernet module to form an Internet platform to connect to a wireless router, using the Android platform;

w5500 ethernet module with stm32

W5500 ethernet module test scenario 2: In the above case, a simple test under the windows system platform can also be performed, and the link test can be performed by running cmd and inputting the ping command;

W5500 Ethernet module testing

W5500 ethernet module  test scenario 3: Various network testing software can also be used for testing;

W5500 Ethernet Module Application Scenarios

W5500 Ethernet module application

Ethernet has a very wide and deep application in various fields and industries, which is mainly due to the high flexibility and easy implementation of Ethernet. Because Ethernet has the advantages of simple networking, low cost, excellent compatibility, reliable connection, and convenient topology adjustment, it has advantages that other network technologies do not have in terms of being a gateway for smart homes, IoT or wireless sensor networks. , which has been vigorously developed and applied.

The W5500 ethernet moduleis small in size and can be applied in a wide range of fields, such as computer, data acquisition, remote control network project transformation and other fields.

W5500 ethernet module Application scenario 1. Unmanned weighing device:

Using the serial port server, weighing instruments, receipt printers, gates and other weighing equipment can be connected to the local area network, and a local area network computer can be used to complete centralized control and data statistics management.

W5500 Ethernet module Unmanned weighing device

W5500 ethernet module Application scenario 2. Remote attendance:

The attendance machine plus the serial port server can transmit the attendance data to the server, and the attendance statistics of the offices all over the country are very convenient.

W5500 Ethernet module Remote attendance

W5500 ethernet module Application scenario 3. Remote control PLC:

The PLC adds a serial port server, and the programming software combines the virtual serial port, so that the PLC can be programmed remotely.

W5500 Ethernet module application remote control

Contact us

If you are interest in more information of W5500 Ethernet module, such as W5500 Ethernet module datasheet, W5500 Ethernet module pinout, W5500 Ethernet network module schematic, W5500 Ethernet module example code etc., welcome to contact us.