---
title: "w5300 hold interrupt pin asserted low"
url: "https://maker.wiznet.io/forum/13524"
markdown_url: "https://maker.wiznet.io/forum/13524/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "sparrow"
created: "2019-10-14T10:31:40+09:00"
last_activity: "2019-12-27T00:30:12+09:00"
language: "en"
views: 946
replies: 6
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# w5300 hold interrupt pin asserted low

## Question

Asked by sparrow on 2019-10-14 in Ethernet Chips.

Hello! I am using w5300 as server in TCP mode. W5300 connected to DSP. I have a w5300 driver and it work fine in some task. Now I have a new task, where data flow increase, and after some second of interconection with PC client, w5300 drop interrupt pin, and I can’t acknowledge it in ISR for inerrupt complete.

## Replies

### Reply 1 by sparrow, 2019-11-06

Ok, thank you! Add this to my ISR.
Now I have interest conditionof wiznet chip, when RSR value is 0. And SSR value is 0x11.
I assume, that rx fifo is full at this time. Is it so?

### Reply 2 by sparrow, 2019-11-06

Thank you!
First phenomenon from errata seems like to my problem. But I not execute close/disconnect.
DSP just send data and freezes at waiting for SENDOK acknowledgment:
WIZnetSendOk[n]=false;
wrWIZnetReg(Sn_CR(n))=CMD_SEND;
while(!WIZnetSendOk[n]);
////(WIZnetSendOk[n] set in ISR)

### Reply 3 by sparrow, 2019-11-07

```
void WIZnetWrite(BYTE *Buf,long Length,long n)
{	
	long LocLen,i,j,k,ind,FreeSpace;
	WORD dataWrite;
	WORD* wp = (WORD*)Buf;
	if(WIZnetSocketState[n] != CONNECTED)	return;

	if(((DWORD)Buf)&0x01)
	{	WritingCycle(oddCopy,Buf,Length,n);
	}
	else
	{	WritingCycle(evenCopy,Buf,Length,n);
	}
}

void WritingCycle(DataOperation f,BYTE *Buf,long Length,long n)
{
	long LocLen,ind,j,FreeSpace;
	WORD dataWrite;
	
	FreeSpace=getFreeSpace(n);
	for(ind=0;ind<Length && WIZnetSocketState[n] == CONNECTED;)
	{	if(FreeSpace == 0)
		{	for(j=1000/5;j>0;j--)	// ~1000 нс
				asm("nop;");
			FreeSpace=getFreeSpace(n);
			if(FreeSpace == 0)	continue;				
		}
		LocLen=min((Length-ind),FreeSpace);
		f(LocLen,Buf,ind,n);			
		setSizeTxData(n,LocLen);
		ssync();
		WIZnetSendOk[n]=false;
		wrWIZnetReg(Sn_CR(n))=CMD_SEND;
		DWORD guard=1000000;
		while(!WIZnetSendOk[n])
		{   asm("nop;");
		}
		dataWrite=rdWIZnetReg(Sn_MR(n));
		ssync();
		ind+=LocLen;
	}
	return;	
}
inline void oddCopy(long WrLen, BYTE* Buf,long ind,long n)
{	long i=0,k=0;
	WORD dataWrite;
	for (i=0;i<WrLen/2;i++)
	{	dataWrite = (Buf[ind+k])|(Buf[ind+k+1]<<8);	
		wrWIZnetReg(Sn_TX_FIFOR(n))=dataWrite;;
		k+=2;
	}
	if (WrLen&0x01)
	{	wrWIZnetReg(Sn_TX_FIFOR(n))=(WORD)(Buf[ind+k]);
		k++;
	}
}
```

### Reply 4 by sparrow, 2019-11-07

Thank you!
I add your modification, but still has 0x11 at SSR.
I add guard counter and sending CMD_DISCON for case where counter decrement to 0. This so rough, but reconnect reset 0x11 state. And…not always.
Have you idea how to avoid this state?

### Reply 5 by sparrow, 2019-11-11

So this udp sending didn’t break current tcp connection?

### Reply 6 by sparrow, 2019-12-03

Please, explain, whether the current connection will be preserved?

---

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