About Sn_TX_WR value
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: About Sn_TX_WR value
by Eugeny ·
UDP is networking protocol, your connection is wired Ethernet.
Sounds you do things correctly, and there’s something wrong here. Like register gets 0xFFE0. Are you sure that your software/hardware handles bit 15 properly - as it looks like bit 15 is being always reset, thus causing 0x7FE0+0x20=0x0000.
RE: RE: About Sn_TX_WR value
by engcif ·
Register does not gets 0xFFE0 it gets 0x7FE0 and than after adding a value I set it to 0x8000. After data transmission is complete it gets 0x0000. It does not get 0x8020 or other values greater than 0x8000.
How can I prevent it from growing up to 0x8000? It starts at 0x0000 after reset.
RE: About Sn_TX_WR value
by Eugeny ·
You can not. It is a cyclical pointer/byte counter.
First you must prove that you really write 0x8000 in there with bit 15 set.
You said that yoy “write FPGA code … W5100s”, and then append code in C. Not sure C can be compiled to hardware. SystemVerilog can. Thus I suspect there’s a layer of another software/firmware and hardware between your C program and W5100s SPI write cycle. You may have simply lose bit 15 somewhere.
RE: About Sn_TX_WR value
by engcif ·
Here is the proof, it take time to find the data on the logic analyzer but finally i did.
As I said I am writing FPGA code for W5100S. To make myself sure, I have inspected the C code which was given in “w5100s.c”.
I am writing my code in vhdl and it is running on a real hardware.
So as i have proved that I am not losing bit 15 do you have any other idea?
RE: About Sn_TX_WR value
by Eugeny ·
Good. Can you, as a test, perform pointer write in two steps - two SPI frames, a byte at a time? First frame F0 04 24 80 and second F0 04 25 00? Also try using SEND command instead of SEND_MAC. I do not know solution to your exact problem, thus we must experiment to see the difference.
RE: About Sn_TX_WR value
by engcif ·
This is for SEND_MAC command:
RE: About Sn_TX_WR value
by engcif ·
This is for SEND command:
RE: About Sn_TX_WR value
by Eugeny ·
And? Still the same issue with pointer going 0x0 rather than 0x8000?
RE: About Sn_TX_WR value
by engcif ·
I am afraid yes. Are we expecting to have 0x8000 and even 0x8020 maybe in the next transmit and up to 0xFFFF right?
I have an idea. I will keep a Sn_TX_WR pointer on my side (host/FPGA). After each transmit I will update my register and write the content to Sn_TX_WR. So there will be no need to read Sn_TX_WR pointer. I will just write it with the new value. Because when I write 0x8000 and than read it back again after writing my data to tx memory, it gives 0x0000 instead of 0x8000. So eventually I am updating it to 0x0020 instead of 0x8020 and it dumps tx memory… I will try it and keep you informed.
RE: About Sn_TX_WR value
by Eugeny ·
Yes, I would expect this behavior. At least other chips from the family behaves this way. The pointer is 16-bit, however it is not explicitly stated in the datasheets. Anyway having 15-bit pointer would be a nightmare (must be a multiple of byte otherwise bit-wise operations are required).
You seem to perform properly, thus there must be something else. Please check SPI timing against datasheet (pages 102-104), try lowering clock speed and increaseing time between chip selects.
RE: About Sn_TX_WR value
by Shingadaddy ·
The thread - old but - exists and I’m tinkering with one of these so -
Anyone who happens to step into here looking for answers.
(Hint - that’s probably going to get some interesting results.! I know. the Version 1.2.5 datasheet says 0x8000). I just think probably - NOT. Maybe 0x7FFF Making Hex 8000 counts. But not Index or address 0x8000. I might try to prove this when I get time but a decent support person can easily confirm or deny it.
You can write to the Sn_TX_WR register all you want! Seems it wont show you that register content that you just wrote until you do an network SEND command. Then you can read it! Important little detail that can help. Acts like a POINTER! Right?