WIZnet Developer Forum

Polling of the Sn_SR register(s)

We are in the process of evaluating the W5200 using the W5200 pictail plus module + hardware stack + dspic33e mcu.
We optimized/modified the provided sample code for the HW stack.
We added functionality to use the hw interrupt pin for notification of incoming data.
We use socket 0 (udp) for receiving data and socket 1 (udp) for outgoing data.

In the provided sample code we observe extensive polling of the Sn_SR register(s) in the mainloop.
We observe that the Sn_SR register of socket 0 always has the value of 22.

Questions:
Why is (extensive) polling of socket 0 Sn_SR needed?
Except from a socket close, which conditions can cause a (not wanted) change of Sn_SR state?

Hi,
UDP socket is not closed expect socket close command is performed by user.
If you don’t need the UDP’s Sn_SR, It is removable.

Thank you.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.