---
title: "How to add 5500 Ethernet Shield to Raspberry Pi Pico-(Python)"
url: "https://maker.wiznet.io/louis_m/projects/How-to-add-5500-Ethernet-Shield-to-Raspberry-Pi-PicoPython/"
markdown_url: "https://maker.wiznet.io/louis_m/projects/How-to-add-5500-Ethernet-Shield-to-Raspberry-Pi-PicoPython/md"
type: "UCC: User Created Content"
author: "Louis"
author_url: "https://maker.wiznet.io/louis_m/"
original_author: "louis_m"
original_url: "https://iotedition.tistory.com/2"
published: "2021-06-22"
language: "en"
hardware: ["Raspberry Pi Pico", "WIZnet W5500", "WIZnet W5500 Ethernet Shield"]
likes: 0
views: 1444
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to add 5500 Ethernet Shield to Raspberry Pi Pico-(Python)

> How to add 5500 Ethernet Shield to Raspberry Pi Pico-(Python)

Original author: louis_m (source: https://iotedition.tistory.com/2)

## Components

- **Raspberry Pi Pico** x 1 ([docs](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html))
- **WIZnet W5500** x 1
- **WIZnet W5500 Ethernet Shield** x 1: Pico Shield

## Documents and links

- [Pico_Ethernet_Shield.py](http://maker.wiznet.io/uploads/2021/06/pico_ethernet_shield.py) (code)

## Article

> *The W5500 chip is a Hardwired TCP/IP embedded Ethernet controller that enables easier internet connection for embedded systems using SPI (Serial Peripheral Interface)*

![img](https://www.wiznet.io/wp-content/uploads/2015/04/w5500_side-500x489.jpg)

## Instructions

![img](https://blog.kakaocdn.net/dn/mju3k/btq6Jx5Kgsa/aO0FhbKIxxGGJKEpkGWX0k/img.png)

### Circuit Python Installation

- Download the **.uf2** file from the below link.
  CircuitPython 6.2.0- [adafruit-circuitpython-raspberry_pi_pico-en_US-6.2.0.uf2](https://downloads.circuitpython.org/bin/raspberry_pi_pico/en_US/adafruit-circuitpython-raspberry_pi_pico-en_US-6.2.0.uf2)

- Push and hold the BOOTSEL button and plug your Pico into the USB port of your Raspberry Pi or other computer. Release the BOOTSEL button after your Pico is connected.

![img](https://blog.kakaocdn.net/dn/QImZP/btq6tUzOcA3/MsfI80jIbVJ59XfyV0Jbz1/img.jpg)

- It will mount as a Mass Storage Device called RPI-RP2.

- Drag and drop the CircuitPython 6.2.0 ***.uf2*** file onto the RPi-RP2 volume. Your Pico will reboot and run CircuitPython.

- Then, you can see "CIRCUITPY" drive on your system.

- Now, we're ready to run the code on python code.py with CircuitPython.

![img](https://blog.kakaocdn.net/dn/bv6fPl/btq7QangGaL/gireb1MkjyE1xCcwPvglmK/img.png)

++More examples with W5500

<https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/micropython-or-circuitpython>

### Connect W5500 Ethernet Shield to Raspberry Pi Pico

> *Raspberry Pi Pico pin map*
>
> ![img](https://blog.kakaocdn.net/dn/bZlOP6/btq7oIff6Dx/XSI9VDZ0LZKBKMUChjJPRk/img.png)
>
> W5500 Ethernet Shield pin map
>
> ![img](https://blog.kakaocdn.net/dn/bbwFoP/btq7tZl2wmo/R9tnKW4ZCR3gNYizgdqn4K/img.png)
>
> - **Use SPI0 on Raspberry Pi Pico.**
>
> - **Be aware of the direction and insert it carefully. If you look at the Ethernet shield, there is a mark indicating the shape of the USB. The USB direction of the Raspberry Pi Pico should be the same.**
>
> ![img](https://blog.kakaocdn.net/dn/P1T1m/btq6COUUNfx/PIIaHuLzqn9bNUVu90KuJk/img.png)

### Add W5500 adafruit_wiznet5k python library

- We need to prepare some libraries from the ***Adafruit*** learning page before ping test.

<https://learn.adafruit.com/ethernet-for-circuitpython/circuitpython-setup>

- Make sure your board's **lib** folder contains the following files and folders copied:

> adafruit_wiznet5k adafruit_bus_device adafruit_requests.mpy

**Download[adafruit-circuitpython-bundle-6.x-mpy-20210409.zip](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20210409/adafruit-circuitpython-bundle-6.x-mpy-20210409.zip)unzip** and find **adafruit_requests.mpy.**

![img](https://blog.kakaocdn.net/dn/dbmPzw/btq7HDZaksw/7RzyTc6tG7FCKIkVxdq9X0/img.png)

### REPL, Open serial terminal for printf()

> Now, let's open the **PuTTY** terminal.
>
> Under **Connection type:** choose the button next to **Serial**.
>
> In the box under **Serial line**, select the serial port you found that your board is using.
>
> In the box under **Speed**, input 115200.

![img](https://blog.kakaocdn.net/dn/lUnzJ/btq7QxikHvv/0rm6aE8qAaUjoHh2NNvwu1/img.png)

Once settings are entered, you're ready to connect to the serial console.

Click "Open" at the bottom of the window, and a new window will open.

- Check the COM port in Device Manager

![img](https://blog.kakaocdn.net/dn/b9Np0e/btq7L00oqR8/1j5T9qp4p26lyc0dGXjVE1/img.png)

### W5500 PING Test

Pico_Ethernet_Shield.py

> **This is the code to set the IP of 192.168.1.100**
>
> **I hope that the PC also has an environment that communicates with 192.168.1.xxx.**

---

import board import busio import digitalio import time from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K SPI0_SCK = board.GP2 SPI0_TX = board.GP3 SPI0_RX = board.GP4 SPI0_CSn = board.GP5 W5500_RSTn = board.GP20 print("Wiznet5k Ping Test (no DHCP)") # Setup your network configuration below # random MAC, later should change this value on your vendor ID MY_MAC = (0x00, 0x01, 0x02, 0x03, 0x04, 0x05) IP_ADDRESS = (192, 168, 1, 100) SUBNET_MASK = (255, 255, 0, 0) GATEWAY_ADDRESS = (192, 168, 0, 1) DNS_SERVER = (8, 8, 8, 8) led = digitalio.DigitalInOut(board.GP25) led.direction = digitalio.Direction.OUTPUT ethernetRst = digitalio.DigitalInOut(W5500_RSTn) ethernetRst.direction = digitalio.Direction.OUTPUT # For Adafruit Ethernet FeatherWing cs = digitalio.DigitalInOut(SPI0_CSn) # For Particle Ethernet FeatherWing # cs = digitalio.DigitalInOut(board.D5) spi_bus = busio.SPI(SPI0_SCK, MOSI=SPI0_TX, MISO=SPI0_RX) # Reset W5500 first ethernetRst.value = False time.sleep(1) ethernetRst.value = True # Initialize ethernet interface with DHCP # eth = WIZNET5K(spi_bus, cs) # Initialize ethernet interface without DHCP eth = WIZNET5K(spi_bus, cs, is_dhcp=False, mac=MY_MAC) # Set network configuration eth.ifconfig = (IP_ADDRESS, SUBNET_MASK, GATEWAY_ADDRESS, DNS_SERVER) print("Chip Version:", eth.chip) print("MAC Address:", [hex(i) for i in eth.mac_address]) print("My IP address is:", eth.pretty_ip(eth.ip_address)) while True: led.value = not led.value time.sleep(1) print("Done!")

---

Copy the content to code.py on your RPi Pico and save. ![img](https://blog.kakaocdn.net/dn/twhwE/btq7tGaAEHM/6gevcnDoTTZ5tTKuCekE30/img.png) Let's run the PING test on the laptop, and the results will show as below. ![img](https://blog.kakaocdn.net/dn/bgNl6j/btq7QvkweyO/Vvh2nCoLKSNkJkw11CSSH0/img.png) Thank you.

---

Source: https://maker.wiznet.io/louis_m/projects/How-to-add-5500-Ethernet-Shield-to-Raspberry-Pi-PicoPython/
