---
title: "Is W5100 Listen Mode Persist?"
url: "https://maker.wiznet.io/forum/13174"
markdown_url: "https://maker.wiznet.io/forum/13174/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "FPGA Friend"
created: "2019-01-20T10:00:07+09:00"
last_activity: "2019-01-21T08:57:50+09:00"
language: "en"
views: 492
replies: 5
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Is W5100 Listen Mode Persist?

## Question

Asked by FPGA Friend on 2019-01-20 in Ethernet Chips.

Hi
when i set the W5100 on Listen Mode(Sn_SR = SOCK_LISTEN), is it persistence or have time out? if no connection-disconnection from Client not occur (and also no internal close from w5100), is the listen mode persist?

## Replies

### Reply 1 by Eugeny, 2019-01-20

I did not see anything about this state timing out in the datasheet, thus it must be persistent. And it is generally logical - no one knows when request to connect arrives, thus if socket is in LISTEN state it must be there until socket is reconfigured, or connection using *this socket* is requested.

### Reply 2 by FPGA Friend, 2019-01-21

I set the socket 0 OPEN and the set it to LISTEN mode. Then in an infinite test loop i read the S0_SR(0x0403). In Most times, it is SOCK_LISTEN. But some time it becomes 0x08 or 0x02(temporary) and these are out of Sn_SR table!! I have problem with data received length(Sn_RX_RSR ). Some times it becomes false.(0xFF64 instead of 0x0064) May be these problems connected to each other? what can i do with them?

### Reply 3 by Eugeny, 2019-01-21 (in reply to reply 2)

Parallel or SPI mode? I suspect you use parallel mode. What is timing? Please draw the timing diagram.

### Reply 4 by FPGA Friend, 2019-01-21

SPI using Spartan-3
I am using 500 Khz SCK. Timing diagram is hard to discover! I done it according to P.67 of w5100 datasheet.
Is there any other feedback from W5100 to check my code?

- I thought (according to your guide in my another topic) that if i don’t read data the Socket 0 RX Received Size(0x0426-7) should increase. But I tested it and that’s not so.I read just the data size in each RECV int and for each 100 byte data PKT, Size Register is 0x0064. what about this? Does w5100 read only one packet in each time?

### Reply 5 by Eugeny, 2019-01-21

![](https://avatars.discourse-cdn.com/v4/letter/f/898d66/48.png) FPGA_Friend:

> Is there any other feedback from W5100 to check my code?

Sure. 6.3.3 shows that W5100 will respond with 0, 1 and 2 during read cycle.

![](https://avatars.discourse-cdn.com/v4/letter/f/898d66/48.png) FPGA_Friend:

> for each 100 byte data PKT, Size Register is 0x0064

Decimal 100 in hexadecimal ix 0x64.

![](https://avatars.discourse-cdn.com/v4/letter/f/898d66/48.png) FPGA_Friend:

> Does w5100 read only one packet in each time?

No, it gives you amount of data arrived. If two packets will arrive between updating pointers, it will show data length for two packets.

---

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