These sections will guide you through a series of steps from configuring development environment to running ethernet examples using the WIZnet's ethernet products.
- Ethernet Example Getting Started [Circuitpython]
- Hardware requirements
- Development environment configuration
- Ethernet example structure
- Ethernet example testing
- Documentation
The ethernet examples use Raspberry Pi Pico and WIZnet Ethernet HAT ethernet I/O module built on WIZnet's W5100S ethernet chip or W5100S-EVB-Pico ethernet I/O module built on RP2040 and WIZnet's W5100S ethernet chip.
Image | Name | Etc |
---|---|---|
Raspberry Pi Pico | Pico Document | |
WIZnet Ethernet HAT | Ethernet HAT Datasheet | |
WIZnet W5100S-EVB-Pico | W5100S-EVB-Pico Datasheet |
WIZnet Ethernet HAT
Ethernet-HAT has the same pin arrangement and pin spacing as Raspberry Pi Pico. The W5100S and RJ45 are built-in, Ethernet can be used by plugging into the Raspberry pi pico. One thing to note when using HAT is to look carefully at the direction and plug it in. There is a USB shape marked, and this direction and the USB direction of Pico must be the same.
WIZnet W5100S-EVB-Pico
In the W5100S-EVB-Pico board, GPIO pins are connected the same as the Raspberry Pi Pico board. If Pico uses Ethernet, PIO16, GPIO17, GPIO18, GPIO19, GPIO20, and GPIO21 pins cannot be used. It is a pin used inside the RP2040 board.
I/O | Pin Name | Description |
---|---|---|
I | GPIO16 | Connected to MISO on W5100S |
O | GPIO17 | Connected to CSn on W5100S |
O | GPIO18 | Connected to SCLK on W5100S |
O | GPIO19 | Connected to MOSI on W5100S |
O | GPIO20 | Connected to RSTn on W5100S |
I | GPIO21 | Connected to INTn on W5100S |
I | GPIO24 | VBUS sense - high if VBUS is present, else low |
O | GPIO25 | Connected to user LED |
I | GPIO25 | Used in ADC mode (ADC3) to measure VSYS/3 |
To test the ethernet examples, the development environment must be configured to use Raspberry Pi Pico. The ethernet examples were tested by configuring the development environment for Windows. Please refer to the '9.2. Building on MS Windows' section of 'Getting started with Raspberry Pi Pico' document below and configure accordingly.
STEP - 1 : Installing CircuitPython
Install CircuitPython
on Raspberry Pi Pico by referring to the link above.:point_down:
It makes it easier than ever to get prototyping by requriring no upfront desktop software downloads. Simply copy and edit files on the CIRCUITPY
drive to iterate.
You edit and save your code on code.py, run your code on the board.
Let's test "LED on" and "LED off" code. Actually, just visit the below page to blink led on your rpi pico board.
STEP - 2 : Setup WIZnet Ethernet Libraray
-
Copy the WIZnet library into the lib folder inside the Raspberry Pi Pico. https://learn.adafruit.com/ethernet-for-circuitpython/circuitpython-setup
Before continuing, make sure your board's lib folder has at least the following files and folders copied over:
adafruit_wiznet5k
adafruit_bus_device
adafruit_requests.mpy
- you need to open
PuTTY
. Under Connection type: choose the button next to Serial. In the box under Serial line, enter the serial port you found that your board is using. In the box under Speed, enter115200
.
- To see your COM port number, please open
Device Manager
on your Windows.
- see the terminal screen as follows. If you connect the WIZnet Ethernet HAT, you can see the
Chip Version:W5100S or W5500
Ethernet examples are available at 'RP2040-HAT-CircuitPython/example/' directory. As of now, following examples are provided.
Check if the network is connected normally and if the data is sent to each other.
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.
- Copy the content to code.py on your RPi Pico and save.
- Press the
Win+R
key to enter cmd and press Enter or OK to execute the command prompt.
- When the command prompt window appears, type the ping command and press Enter.
ping 192.168.1.100 (-option)
- Ping tests begin as packets are exchanged between hosts.
- If you look at the time and loss rate among the statistical results, you can find out the status of the Internet network.
- It's normal when you see the screen below, and the packet loss rate is important.
Documentation for WIZnet Ethernet HAT and Raspberry pi pico board
An RP2040-based microcontroller board
Getting started with Raspberry Pi Pico
C/C++ development with Raspberry Pi Pico and other RP2040-based microcontroller boards
Please refer to 'README.md' in each examples directory to find detail guide for testing ethernet examples.