We will continue to go through the Common Registers.
In this entry, I will provide more details on the RX and TX buffer Memory register.
Here is a brief summary on how to seup the RX and TX buffer memory
According to the Value of S1 and S0, the memory is assigned to the socket within the range of 8KB.
If there is not enough memory to be assigned, the socket should not be used. The initial value is 0x55 and
the 2K memory is assigned to all 4 sockets respectively.
For Example) When setting the register as 0xAA, the 4KB memory will be assigned to each socket. However, the total memory size is 8KB.
The memory is normally assigned starting from the socket 0. In this example, 4KB will be assigned to Socket 0 and Socket 1 respectively. Therefore, these two sockets used up all 8KB memory available. Socke 2 and Socket 3 will not be usable.
In W5100, you will find the function sysinit() to setup the buffer register.
As you can see, the first parameter is for the transfer buffer and the second parameter is for the receiving buffer.
void sysinit(uint8 tx_size, uint8 rx_size)
For example, to share the buffer memory equally (2KB) you can use the following code:
sysinit(0x55,0x55);
Notice that both Receiving buffer and Transfer Buffer should have the same setting
We will continue next week again on the common register part 3. Thank you
See you
WIZnet Hong Kong
No comments:
Post a Comment