WIZnet Ethernet HAT[RP2040] + Loopback

by louis_m in Circuits > Raspberry Pi

215 Views, 2 Favorites, 0 Comments

WIZnet Ethernet HAT[RP2040] + Loopback

pico Loopback.jpg

An Ethernet module is a server and returns the data sent when the client connects and sends the data.

Overview

hat.png
chip.jpg
rp2040.jpg

WIZnet Ethernet HAT (Hardware Attached on Top) is a Raspberry Pi Pico pin-compatible board that utilizes W5100S and supports both 3.3V & 5V.

Please refer to this link to find more information about W5100S.

  • Raspberry Pi Pico Pin-Compatible
  • Ethernet (W5100S Hardwired TCP/IP CHIP)
  • Product page : https://docs.wiznet.io/Product/iEthernet/W5100S/o...
  • Support 4 Independent Hardware SOCKETs simultaneously
  • Support SOCKET-less new Command: ARP-Request, PING-Request
  • Support Auto-MDIX only when Auto-Negotiation mode

RP2040 Datasheet - https://www.raspberrypi.org/documentation/microco...

Prepare

Circuitpython.png
lib.jpg

Prepare Hardware

1. Combine WIZnet Ethernet HAT with Raspberry Pi Pico.

2. Connect ethernet cable to Ethernet HAT ethernet port.

3. Connect Raspberry Pi Pico to desktop or laptop using 5 pin micro USB cable.

- If you use W5100S-EVB-Pico, you can skip '1. Combine...'

Prepare Software

1. Installing CircuitPython

Install CircuitPython on Raspberry Pi Pico by referring to the link above.
- https://learn.adafruit.com/getting-started-with-ra...

Download the below uf2 file link on your computerCircuitPython 7.0.0 - https://downloads.circuitpython.org/bin/raspberry...

2.Setup WIZnet Ethernet Library

Copy the WIZnet library Into the lib folder inside the Raspberry Pi Pico.

https://learn.adafruit.com/ethernet-for-circuitpyt...

Before continuing, make sure your board's lib folder has at least the following files and folders copied over: https://github.com/Wiznet/RP2040-HAT-CircuitPytho...

adafruit_bus_device

adafruit_wiznet5k



Install Programs

Terminal.jpg
PORT.jpg

The following serial terminal program is required for Loopback test, download and install from below links.

Tera Term

Hercules

Before this, you should find the Raspberry Pi Pico COM port number from "Device Manager" on your PC.

How to LoopbackExample

lib copy.jpg
excute.jpg

Setup Loopback Example

- download https://github.com/Wiznet/RP2040-HAT-CircuitPython/tree/master/examples/Loopback

Press "Ctrl+D" on the terminal window. you can see the messages as follows.

The server was created by opening the socket with IP address 192.168.1.100 and PORT 5000.

Connect Client to Server

hercuels.jpg
connect.jpg

Open the Hercules program to set [IP Address] and [PORT number] and Connect to the Server.

You can check through the terminal that the client has accessed the server.

loopback.jpg

If you send the phrase Loopback Test, you can see that you are sending and receiving data.

Schematics

schematic.png