Dear, tell me about working with the module. I’m doing something wrong, but what’s the problem?
In the W5500 I use only zero socket (I work with AVR).
All exchange with the module occurs at a fixed length in single-byte mode (Fixed Lenght Data Mode)
When initializing, I configure the module as a server:
- I reset the module, wait 2 seconds after reset
- Even though the module itself breaks 16kB into 8 buffers, I specify all the same that the receive buffer and the Socket transfer buffer 0 = 2kB
- I assign the module MAC, IP, Gateway, Mask, and install the local port
- Socket 0 install TCP protocol
- I set an interrupt from Socket 0 for all socket events. (connection, break, timeout, data arrival, data sending)
- Socket commands - I open a socket (open) and then immediately translate the command to LISTEN
- the module is pinged, the connection to the port is, the interruption is generated by the connection and the connection is broken. When the interrupt arrives, I tell the module that I responded (the SIR register)
- From the client came the data: I read the register of the size of the received data (S0_RSR) first the high byte, then the low one. (in old W3300 modules this is important)
- I read the register of the beginning of the data in the buffer (S0_RX_RD), first the high byte and then the low byte.
- I read the end-of-data register in the buffer (S0_RX_WR), first the high byte and then the low byte.
- I transfer data from the W5500 receive buffer to the local AVR buffer.
- In the register S0_RX_RD I write the value S0_RX_WR. first low byte then high byte. I give the command to the module that I read everything (in the register S0_CR <- 0x40)
Everything works until the port while the register S0_RX_RD has values less than 0x0800.
let’s say S0_RX_RD = 0x07F0, and S0_RX_WR = 0x0840.
as soon as I assign a S0_RX_RD value above 0x0800 (0x0840 in our example) everything is fucking hanging …
in theory, these registers run in the range from 0x0000 to 0xFFFF and in a circle. and then he stared at 0x0800 and at least kill …
increased the buffer to 4kb, all one …> 0x0800 hung …
Tell me pliz … what am I doing wrong