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.
------
change the date 2022.03.15
You can refer the below link.
https://www.hackster.io/irinakim1225/micropython-on-rp2040-dhcp-with-wiznet5k-ethernet-aa2bb6
I changed the repository path >> latest Github : https://github.com/Wiznet/RP2040-HAT-MicroPython
----------
old 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.
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.
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
After that, I will try to modify by W5100s and W5100 in the drive of wiznet5k..
Comments
Please log in or sign up to comment.