Not getting send interrupt
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Not getting send interrupt
by Omer ·
Hi,
Below is my send function, Most of my code is similar to the wiznet sample code except my application code:
uint16_t send(SOCKET s, const uint8_t* p_ucharDataBuf, uint16_t ushLen)
{
uint8_t ucharStatus=0;
uint16_t ushRet=0;
uint16_t ushFreeSize=0;
uint16_t ushtxrd_after_send;
uint16_t ushtxrd_before_send;
/* while ( (read_wiznet_reg(Sn_IR(s)) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK )
{
if ( read_wiznet_reg(Sn_SR(s)) == SOCK_CLOSED )
{
close(s);
return 0;
}
}*/
//write_wiznet_reg(Sn_IR(s), Sn_IR_SEND_OK);
}
My ISR processing function is below. This function is called from an ISR, it saves the interrupt type, clears the wiznet interrupt and sets an TCP_FLAG.
void processWiznetISR(void)
{
uint8_t ucharIRvalue;
uint8_t ucharSNIRvalue;
//uint8_t ucharIRvalue = getSn_IR(SOCKET_0);
// write_wiznet_reg(Sn_IR(m_structTCPData.m_ucharCurrentSocket), 0xFF);
ucharIRvalue = read_wiznet_reg(W5100_IR);
ucharSNIRvalue = getSn_IR(0);
}
And below is my interrupt processing functions:
void processSocketCommand(void)
{
if(TCP_FLAG == TRUE)
{
if (I_STATUS[SOCKET_0] != 0)
{
/* save interrupt value*/
m_structTCPData.m_ucharCurrentSocket = SOCKET_0;
processTcpCommand(I_STATUS[SOCKET_0]);
//write_wiznet_reg(Sn_IR(0), I_STATUS[0]);
I_STATUS[SOCKET_0] = 0;
}
if (I_STATUS[SOCKET_1] != 0)
{
/* save interrupt value*/
m_structTCPData.m_ucharCurrentSocket = SOCKET_1;
processTcpCommand(I_STATUS[SOCKET_1]);
I_STATUS[SOCKET_1] = 0;
}
if (I_STATUS[SOCKET_2] != 0)
{
/* save interrupt value*/
m_structTCPData.m_ucharCurrentSocket = SOCKET_2;
processTcpCommand(I_STATUS[SOCKET_2]);
I_STATUS[SOCKET_2] = 0;
}
if (I_STATUS[SOCKET_3] != 0)
{
/* save interrupt value*/
m_structTCPData.m_ucharCurrentSocket = SOCKET_3;
processTcpCommand(I_STATUS[SOCKET_3]);
I_STATUS[SOCKET_3] = 0;
}
/* Clear the TCP_FLAG since all the interrupts have been processed /
TCP_FLAG = FALSE;
/ Clear the interrupt */
//write_wiznet_reg(Sn_IR(m_structTCPData.m_ucharCurrentSocket), 0xFF);
}
}
void processTcpCommand(uint8_t ucharSn_IR)
{
uint16_t ushlen = 3;
uint8_t status = 0x01;
}
/* Clear the interrupt */
//write_wiznet_reg(Sn_IR(m_structTCPData.m_ucharCurrentSocket), 0xFF);
}
RE: Not getting send interrupt
by hjjeon0608 ·
Hi,
Most above all, check sending packet is completed.
I want to know just send interrupt doesn’t occur or send procedure is not working.
Best regards.
RE: Not getting send interrupt
by Omer ·
Hi,
The send procedure is working.
When a send a modbus query via Modpoll I recieve the necessary response back.
The only issue here is I dont get an send complete interrupt.
I get the recieve interrupt .
The other issue is I dont get the disconnect interrupt also. I get that interrupt after quiet some time.
But I dont want to tackle that issue right now, since first I want to resolve the send interrupt issue first.
Thanks!!!