---
title: "Cannot Set DPORT W5500"
url: "https://maker.wiznet.io/forum/15816"
markdown_url: "https://maker.wiznet.io/forum/15816/md"
type: "Forum topic"
category: "IO Modules"
author: "taylorh140"
created: "2025-07-24T04:14:58+09:00"
last_activity: "2025-07-24T23:28:48+09:00"
language: "en"
tags: ["W5500"]
views: 4
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Cannot Set DPORT W5500

## Question

Asked by taylorh140 on 2025-07-24 in IO Modules.

I have a W5500 chip that is setup in UDP mode. And I can setup the intial transmissions that i want to occur. But sometimes i want to change the DIPR and DPORT to send to a different destination.

I now have a loop that just checks that the DPORT is set properly before sending any new data.

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

Here I have a loop that has been of setting and checking the DPORT for socket 0.

The two Transactions are:I have previously verified that the chip is indeed in UDP mode and that the socket is OPEN.
- 0x0010 - DPORT
- 0x0E - Write two bytes to socket 0 registers.
- 0x1388 - 5000

- 0x0010 - DPORT
- 0x0A - Read two bytes from socket 0 registers.
- 0xEB6F (NOT 5000)

Is there any other conditions that are required to be met to write to these registers?

## Replies

### Reply 1 by Grace_Koo, 2025-07-24

Hi.

If you don’t mind sharing, could you show how you're setting DIPR and DPORT in your code?
It might help narrow down the issue.

Thank you.

### Reply 2 by taylorh140, 2025-07-24 (in reply to reply 1)

Thanks I`ll bring let you know the details.

Currently the order of operations are:

1. Wait for Sn_CR == 0x00
2. Read Sn_SR and verify it is 0x22 (udp open)
3. Read Sn_TX_FSR and SN_TX_WR
- verify txFSR is large enoug for my data
- Write Data to the TX_BUFFER
4. Clear Sn_IR - SEND_OK and TIEMOUT flags
5. try 8 times:
a. Set Sn_DIPR
b. Set Sn_DPORT
c. Read DPORT
if readback matches the setting continue
6. Set the Sn_TX_WR to the SN_TX_WR + data length and set Sn_CR to SEND

I`m still working out how to make this work more smoothly so any help would be great. Each numbered or lettered item is a single CS transfer.

---

Source: https://maker.wiznet.io/forum/15816
