[size=150]Edit as of Oct 02 2015: the issue was solved.[/size]
Explanation can be found here: [url][From QnA] WIZ108SR RS485].
If you experience issues like this you can contact me for tips.
…
Problem: I receive correct volume of data, but data is corrupt.
I use TCP / HTTP communication, using hardware interrupts. Sending exactly 128 KBytes of data plus HTTP header. On approximately 40th Kilobyte image I receive starts getting differences in 16-bit simple checksum (word sum of all bytes).
I do the following:
- setting all registers in W5100, preparing interrupt handler, opening TCP, establishing connection.
- I start getting interrupt requests.
- At the entrance to interrupt routine I check socket IR flags, and reset them all immediately writing 0FFh into respective IR.
- Then I get count of bytes from RSR register and read them from the W5100’s RX buffer, then update RXRD register and write RECV command to command register of the socket.
- process continues until remote host breaks established connection.
As I said - size of data is correct, but contents are corrupt.
Another issue is that communication is very slow. Receive/send LEDs flash once per second, and transfer takes 20 seconds. It is 6 KBytes per second. Given that algorithm and CPU I use are not fastest, let’s take “real” speed of service is 10 KBytes per second. Nearby computer running Windows XP achieves 500 KBytes per second for the same web-server from the same subnet.
If my algorithm is correct, I suspect W5100 experiences errors during communication and is busy with retransmission - retry is set to 400ms and 8 attempts. Is it possible to get such retransmission/line quality statistics from W5100?
Some time ago I sent several emails to Joachim Wuelbeck @ Wiznet asking for correct model of RJ45 with built-in magnetics. He never replied. As I had to proceed with project, I chosen J1006F01P, which has symmetrical transformer, but slightly different circuit diagram (comparing to sample wiznet uses) without 75 ohm resistors and 1000pF capacitor onto the ground. Can it be the cause? Again, how to prove it - any statistics in W5100 on its quality of communication?
In overall I find Wiznet hardware documentation, and documentation in overall to be of poor quality - some areas are covered by just several words (e.g. RJ connector and transformer types), some have serious mistakes (that issue with read-only socket IR register which appeared to be have been writable - in W5100 and W5200 documentation). Support is also inadequate to the complexity of device.
Eugeny Brychkov, Ph.D.
[url]https://www.linkedin.com/in/brychkov[/url]