---
title: "How to use PWM as W5x00 clock"
url: "https://maker.wiznet.io/momososo/contest/how-to-use-pwm-as-w5x00-clock/"
markdown_url: "https://maker.wiznet.io/momososo/contest/how-to-use-pwm-as-w5x00-clock/md"
type: "Contests"
author: "momososo"
author_url: "https://maker.wiznet.io/momososo/"
original_author: "WEN-LIANG LIN"
license: "GNU General Public License, version 3 or later (GPL3+)"
published: "2024-10-05"
language: "en"
tags: ["W5500"]
hardware: ["WIZnet W55RP20-EVB-Pico"]
likes: 1
views: 1934
comments: 2
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to use PWM as W5x00 clock

> Demo with W55RP20-EVB-PICO use RP2040 PWM output 25MHz as W5500 clock.

Original author: WEN-LIANG LIN

## Components

- **WIZnet W55RP20-EVB-Pico** x 1 ([docs](https://wiznet.io/products/powered-by-raspberry-pi/w55rp20-evb-pico))
- Software: **MicroPython** ([docs](http://micropython.org/))

## Documents and links

- [loopback](https://maker.wiznet.io/_lib/download.asp?path=project/5777&downfile=loopback%2Epy) (code): add PWM at W5x00 chip init
- [schematics-w55rp20-evb-pico](https://maker.wiznet.io/_lib/download.asp?path=project/5777&downfile=schematics%2Dw55rp20%2Devb%2Dpico%2D2b5c59345ba20021810f016f1ac5149f%2Epng) (schematics): remove Y1

## Article

#### Story

From schematic we know that W55RP20-EVB-PICO have two crystal, 12MHz for RP2040 and 25MHz for W5500 chip.

<https://docs.wiznet.io/Product/ioNIC/W55RP20/w55rp20-evb-pico#schematic>

This project is target to remove 25MHz and use RP2040 PWM output 25MHz as W5500 clock.

#### Hardware

[W55RP20-EVB-PICO](https://docs.wiznet.io/Product/ioNIC/W55RP20/w55rp20-evb-pico)

#### Software

[micropython](https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-micropython/releases/tag/v1.0.0)
[hercules](https://www.hw-group.com/software/hercules-setup-utility)

[Thonny](https://thonny.org/)

#### Build

First I find out Y1 25MHz on board and with [PCB file on github](https://github.com/Wiznet/Hardware-Files-of-WIZnet/tree/master/09_ioNIC/W55RP20-EVB-Pico-V100) I identify W55-XI pin.

![](https://maker.wiznet.io/upload/ckeditor5/32692668%5F1728131294%2Ejpg)

Remove Y1 and solder 1K ohm connect board pin19(GP14) and W55-XI pin.

![](https://maker.wiznet.io/upload/ckeditor5/32692668%5F1728131693%2Ejpg)

#### Code

Since I remove w5500 clock, it no longer works properly. It must be given clock during initialization, use below code to output PWM.

```python
from machine import PWM #PWM module

#W5x00 chip init
def w5x00_init():
    PWM(14,freq=25000000,duty_ns=20) #make PWM as w5x00 clock
    
    spi = WIZNET_PIO_SPI(baudrate=31_250_000, mosi=Pin(23),miso=Pin(22),sck=Pin(21)) #W55RP20 PIO_SPI
    nic = network.WIZNET5K(spi,Pin(20),Pin(25)) #spi,cs,reset pin
    nic.active(True)
```

Measure PWM pin signal.

![](https://maker.wiznet.io/upload/ckeditor5/674119531%5F1728426225%2Ejpg)

![](https://maker.wiznet.io/upload/ckeditor5/674119531%5F1728426296%2Ejpg)

Run example Loopback, it work good as use Y1.

![](https://maker.wiznet.io/upload/ckeditor5/32692668%5F1728132138%2Epng)

#### Conclusion

I make a simple project it can reduce the BOM cost. But the reliability requires longer testing.

---

Source: https://maker.wiznet.io/momososo/contest/how-to-use-pwm-as-w5x00-clock/
