Please Reply : TCP Server Interrupt issue
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: Please Reply : TCP Server Interrupt issue
by Coccoliso ·
Hi,
IR It reads to see which socket has generated the interrupt ( bits S0_INT/S3_INT datasheet page 21 )
IMR to mask the intervention of the interrupt for the 4 socket ( bits IM_IR0/IM_IR3 datasheet page 22 )
Sn_IR to know what condition generated the interrupt on a given socket ( datasheet page 27 )
I think the first is due to the condition of disconnection and the second is due to the closure of the socket but reading the n socket register (Sn_IR ) you should figure out what caused it and act accordingly.
If all 4 socket must act in the same way (in response) I do not understand what is the need to know whether the socket is and a wrong thing is to store the state that then could change in the meantime you’re going to answer … if state changes in “closed” the socket becomes available only after the timeout and you can not use it to that time (30 secs) and you lose a socket. You must be able to check and create the response “in line” when an interrupt occurs and then clear the interrupt reg.
… unless you can find something else to do
).
As I’ve already been to answer the use of interrupts in the case of TCP server is unnecessary… the purpose is to provide answers then you’re always waiting for the same condition and between test a pin ( cleared by interrupt) or read a register there is no changes except the hw latency (and since we really do not have other things to do in the meantime
In a case you must first read the IR register and understand what is the socket and then read if is a connection and then read request size and then read the request… in the other case directly read socket stat and then read the request size and then read the request. Only a main a loop with a for/next (4 steps) on socket stat reg and you are unsure of the right answer in the shortest time possible while other sockets are waiting for their correct for/next step in their own timeout period.