W5100 Sn_TX_WR Range


Please teach me the range of each Sn_TX_WR value (TX Write Pointer).

I have set the TMSR = 0x55 (each Tx Memory Size is 2KB/0x0800).
The each TX base address and size is
S0_Tx_Base=0x4000, S0_Tx_Size=0x0800
S1_Tx_Base=0x4800, S1_Tx_Size=0x0800
S2_Tx_Base=0x5000, S2_Tx_Size=0x0800
S3_Tx_Base=0x5800, S3_Tx_Size=0x0800

I have actually tested the W5100 to check the reset location of socket-1 TX Write Pointer(S1_TX_WR).
And then I got the value of S1_TX_WR = 0xAF6E.
I do not know whether the value 0xAF6E of S1_TX_WR is very large or not.

Is the value 0xAF6E of S1_TX_WR is very large? or proper?

The reset specific location of Sn_TX_WR(TX Write Pointer) is 0x0000 in W5100 data sheet page-34.

What kind of a reson have I got the actual reset location value S1_TX_WR = 0xAF6E?
Why have not I got the reset specific location value of Sn_TX_WR 0x0000?

Ogawa-san, all the counters and pointers should be kept 16-bit, thus these values you see are correct ones.
But the data window access should be limited to the size of the buffer for respective socket. It is well explained in the datasheet in the “functional description” section.

As far as I used W5100, I can confirm that - after reset this pointer is set to 0.

This is good question, and the first issue which you need to consider is “reset” quality. Value of 55 is default for W5100, thus I propose you to perform software reset (using MR and wait until reset bit clears = reset complete) and check the WR pointer. This way you will be sure that you have 100% proper reset on the chip. In general, before using W5100 in my software after reset, I always perform software reset.

Hello Eugeny-san

Thank you for your advices.
Your answer includes the very important information.
The W5100 sample program in japanese technical magazine “Interface Dec/2009” has the no-good C-code contents what includes the infinite increments and updating action for TX write pointer. I have been doubting this bad sample program descriptions. I have certain evidence via your proper advices.