---
title: "How to add wiznet5k to Raspberry pi pico -micropython"
url: "https://maker.wiznet.io/pranchal/projects/How-to-add-wiznet5k-to-Raspberry-pi-pico-micropython/"
markdown_url: "https://maker.wiznet.io/pranchal/projects/How-to-add-wiznet5k-to-Raspberry-pi-pico-micropython/md"
type: "UCC: User Created Content"
author: "pranchal"
author_url: "https://maker.wiznet.io/pranchal/"
original_author: "pranchal"
original_url: "https://www.hackster.io/irinakim1225/how-to-add-wiznet5k-to-raspberry-pi-pico-micropython-a6c351"
published: "2022-02-04"
language: "en"
hardware: ["Raspberry Pi Pico", "WIZnet wiz850io"]
likes: 0
views: 379
comments: 1
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to add wiznet5k to Raspberry pi pico -micropython

> How to add wiznet5k to Raspberry pi pico -micropython

Original author: pranchal (source: https://www.hackster.io/irinakim1225/how-to-add-wiznet5k-to-raspberry-pi-pico-micropython-a6c351)

## Components

- **Raspberry Pi Pico** x 1 ([docs](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html))
- **WIZnet wiz850io** x 1
- Software: **thonny.org Thonny** ([docs](https://github.com/thonny/thonny/wiki))

## Article

## Story

I already test the WIZNET5K library using pyboard. So, I thought that it would be easy to port the Raspberry Pi to Pico. Oops....

I realized that the task was never easy because in ports/rp2 folder about network source code.

------

Github :?<https://github.com/irinakim12/micropython/tree/wiznet5k>

If you enter in ports/rp2 folder, you can see the Makefile.

I changed the makefile so that w5500 works by default so you just use the "make" command.

![MakeFile in ports/rp2](https://hackster.imgix.net/uploads/attachments/1375172/image_6o5oZcL0Wz.png?auto=compress%2Cformat&w=740&h=555&fit=max)

MakeFile in ports/rp2

![](https://hackster.imgix.net/uploads/attachments/1375178/bandicam_2021-11-18_16-20-34-272_0YLDYL34SO.jpg?auto=compress%2Cformat&w=740&h=555&fit=max)

If you have completed compiling, you will see that firmware.elf and firmware files are created in build-PICO.

You just have to download it to the pico board.

You can program your Pico by connecting it to a computer via USB, then dragging and dropping a file onto it, so we’ve put together a downloadable UF2 file to let you install MicroPython more easily.

<https://www.raspberrypi.com/documentation/microcontrollers/micropython.html#drag-and-drop-micropython>

```
import network
from usocket import socket
from machine import Pin,SPI
import rp2

def main(): 
    spi=SPI(0,2_000_000, mosi=Pin(19),miso=Pin(16),sck=Pin(18))
    nic = network.WIZNET5K(spi,Pin(17),Pin(20))
    nic.ifconfig(('192.168.100.20','255.255.255.0','192.168.100.1','8.8.8.8'))
    
    while True:
        if nic.isconnected() == True:
            #print(nic.regs())
            s=socket()
            s.connect(('192.168.100.10',5000))
            while True:
                data = s.recv(1500)
                print(data.decode('utf-8'))
                if data != 'NULL' :
                    s.send(data)
            
main()
```

I used the Thonny tool and confirmed that it works.

`Result`

![](https://hackster.imgix.net/uploads/attachments/1375175/bandicam_2021-11-18_16-09-57-636_EUe4JJ7TkB.jpg?auto=compress%2Cformat&w=740&h=555&fit=max)

After that, I will try to modify by W5100s and W5100 in the drive of wiznet5k..

![](https://hackster.imgix.net/uploads/attachments/1375181/image_pdewV1m8hL.png?auto=compress%2Cformat&w=740&h=555&fit=max)

<https://www.wiznet.io/product-item/wiznet-ethernet-hat/>

## **Schematics

### Connect Pico (SPI0) and WIZnet's Chip

![](https://hackster.imgix.net/uploads/attachments/1375168/micropython2_1IaYmbVhCt.jpg)

---

Source: https://maker.wiznet.io/pranchal/projects/How-to-add-wiznet5k-to-Raspberry-pi-pico-micropython/
