MR_ALIGN and RX_FIFOR Problem
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: MR_ALIGN and RX_FIFOR Problem
by alenic ·
Hi,
I use 16 bit data bus mode.
Code in the attachment.
W5300_1.c (4.59 KB)
W5300_1.h (7.76 KB)
Socket_1.c (7.04 KB)
RE: MR_ALIGN and RX_FIFOR Problem
by alenic ·
In the above attachment I set align bit, because I take a code from working project. For this moment it is my solution of my problem.
RE: MR_ALIGN and RX_FIFOR Problem
by alenic ·
I use RTOS (with name RTOS). W5300_recv() is a blocking function. I call it from communication task. Like this:
RE: MR_ALIGN and RX_FIFOR Problem
by alenic ·
I read in datasheet:
[quote]If the host system uses 8 bit data bus width, Sn_RX_FIFOR0 and Sn_RX_FIFOR1 should be
accessed in a pair as like Sn_TX_FIFOR. It is not allowed to access Sn_RX_FIFOR0 and
Sn_RX_FIFOR1 right after accessing Sn_TX_FIFOR0 and Sn_TX_FIFOR1. These are cause
for the incorrect read. In order to prevent this, after reading Sn_TX_FIFOR0 and
Sn_TX_FIFOR1, the host reads any register such as Sn_MR and then access Sn_RX_FIFOR.[/quote]
When I found my problem I thought may be the same rule working in 16 bit mode.
In interrupt I just count the quantity of data packets (or interrupts request). All manipulations with data I make in W5300_recv(). May be, while I process data from one data packet another one will be received so at the end of W5300_recv() I check how many packet in W5300 data buffer and if there is no data packets I switch of the message in this case function W5300_recv() will be blocked in next call while new data comes.
I work with Modbus/TCP protocol and another PC waits an answer before send a new one request so In most cases my communication looks like: request → answer ->request - > answer->…
RE: MR_ALIGN and RX_FIFOR Problem
by alenic ·
Hi,
I do not have equipment at this moment. I will test it after one or two weeks, when new equipment will arrive.
So, I have test schema one PC and board with W5300 and connections between them. On PC side I use modbus pool to generates a requests. PC send a request (12 byte) and waits an answer if there is no answer for 1seconds connections closed. If answer returned from my board PC prints the data and send new request. Delay between request in this case will be 100 ms. On my board I have an ability to print some data via telnet (I use com port RS 232). Here I print rsr register each time I received the data. Usually here 14 byte length 12 modbus header + 2 byte packet info. But some times I read from rsr register 12. In this case I try to print FIFO data and see just modbus header without packet info. In this case I read transaction ID instead packet length and try to read more data that W5300 has in buffer.
RE: MR_ALIGN and RX_FIFOR Problem
by alenic ·
Hi,
Ok, I will check this moment. But as I told after new equipment will come. I will write a result here. Thank You for help!
RE: MR_ALIGN and RX_FIFOR Problem
by alenic ·
Hi,
I solved my problem. I just included reading of RX_FIFO register into critical section.
Thank You.