---
title: "Unable to read from register Sn_RX_RD0"
url: "https://maker.wiznet.io/forum/12135"
markdown_url: "https://maker.wiznet.io/forum/12135/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "john7"
created: "2017-02-07T11:10:14+09:00"
last_activity: "2017-05-04T08:39:46+09:00"
language: "en"
views: 760
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Unable to read from register Sn_RX_RD0

## Question

Asked by john7 on 2017-02-07 in Ethernet Chips.

I send/receive UDP packets. But a lot of packets lost. So while debugging my program I found out that I read the wrong pointer.
So I do the test

```
//WRITE
ptr = 8; 
IINCHIP_WRITE(Sn_RX_RD0(s),(uint8)((ptr & 0xff00) >> 8));
IINCHIP_WRITE((Sn_RX_RD0(s) + 1),(uint8)(ptr & 0x00ff));
//READ
ptr = IINCHIP_READ(Sn_RX_RD0(s));
ptr = ((ptr & 0x00ff) << 8) + IINCHIP_READ(Sn_RX_RD0(s) + 1);
//at this point ptr = 0 !!!
```

So I write a predefined value to Sn_RX_RD0 and read it back and get a wrong value. At this poin i even don’t know if it’s written properly.

## Replies

### Reply 1 by Eugeny, 2017-02-13

Unfortunately this is normal. You will not read new value until specific event.
I recommend you looking into W5100’s datasheet, chapter 5 “Functional description”.
For example, in 5.2.1.1 you will learn that after updating RX_RD register you should issue RECV command, which makes your register update effective. Until this command, RX_RD will read back the old value.
So conclusion is that you should be very careful reading registers, and should only do it in specific conditions. I am sure if you will study those datasheet’s diagrams you will be doing it right.

---

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