Microduino W5500 Network (1)

来自Microduino Wikipedia
跳转至: 导航搜索

Purpose

This course will show you how to have a Ping connection with Microduino-W5500.

Equipment

  • Other Hardware Equipment
    • USB cable One

Schematic

  • Microduino-W5500
  • Microduino-RJ45
  • Microduino-Core
  • Microduino-USBTTL

Stack them and then plug in network cable.

Just as follows:

MicroduinoW5500Show.png

Pin picture of Microduino W5500:

  • Pin Description:
Pin name of W5500 Microduino pin Function
SO D11 Data output of SPI interface
SI D12 Data input of SPI interface
SCK D13 Clock input of SPI interface
CS D10 by default(Also can be changed to D8) Chip selection input of SPI interface
RESET RESET Low-level effective device reset input

Program

[MicroduinoW5500One]

Debugging

Step 1:First, make sure you have _02_Microduino_Ethernet_WIZ library in your IDE and put it into libraries folder of your IDE.

Step 2: If there is previous Ethernet in the library folder of IDE, you need to delete it since the previous Ethernet is compiled according to W5100 protocol.

Then, you need to change _02_Microduino_Ethernet_WIZ file to make library functions corresponding with Microduino in pin.

Find w5100.h in utility folder in _02_Microduino_Ethernet_WIZ library.

Change #define wiz_cs_pin 8 //CS_PIN of the code to #define wiz_cs_pin 10 //CS_PIN.

Step 3: Explain the code: Define the IP address and port:

 // Enter a MAC address and IP address for your controller below.
 // The IP address will be dependent on your local network.
 // gateway and subnet are optional:
 byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
 
 IPAddress ip(192,168,1, 177);
 IPAddress gateway(192,168,1, 1);
 IPAddress subnet(255, 255, 255, 0);
 
 // telnet defaults to port 23
 EthernetServer server(23);
 boolean alreadyConnected = false; // whether or not the client was connected previously

We start service of 23 port in the code and point to a specified IP address.

 // initialize the ethernet device
 Ethernet.begin(mac, ip, gateway);

Start service Step 4: Download the code and pass the compiling.

Step 5: Ping connection!

The simplest way to have a ping connection of W5500 is to check if it is networked correctly. Enter Ping in the computer and check the IP address of the device.

MicroduinoW55001.png

Result

When it is showed as the picture above, it means “connected to network”.

Video