W5300 Receive problem

Hi, I am using W5300 as TCP server, i could send data from W5300 to my laptop running labview client application successfully. I am also able to send data from PC to TCP server(W5300) only when no of bytes from PC is even number…if i send odd no of bytes the Sn_RX_RSR register does not get updated.

one way communication is perfect (Chip to PC) while for another side(PC to chip) is working only for even no of bytes and not for odd no of bytes.

I call my Receive Sn RX FIFOR register after contineous polling Sn RX RSR register and if the Sn RX RSR reg value is not zero then read the Sn RX FIFOR0 and then Sn RX FIFO1 in pair.

i also make provision for reading one extra byte if the Sn RX RSR reg. has odd number value but still Sn SRS does not get upated for odd number of bytes sent from PC.

Can any body help to solve/fix up the problem.

I am using the 8 bit interface with Silab MCU C8051F340 and using the mcu’s GPIO as external bus to interface with W5300.

Hi,

You said the odd bytes data couldnot be received and Sn_RX_RSR couldnot be update. am I right?

Odd number bytes data is no need to config Sn_MR_ALIGN in Sn_MR.

When Sn_MR_ALIGN bit is set, W5300 processed all data as even bytes data and No attach the PACKINFO(included data lenght). (For more detail, refer to datasheet).

Anyway, Did you use the latest W5300 8-bit driver recommended by WIZnet ?

Here the latest driver, [url]http://www.wiznet.co.kr/sub_modules/en/product/product_detail.asp?Refid=681&page=1&cate1=5&cate2=7&cate3=25&pid=1012&cType=2[/url].

Thank you.

ThANK YOU,
But it is no where mentioned that when we set align bit= 1, it will not process any odd number bytes received.
In the datasheet the example of receiving 5 bytes is shown which takes no of byte info from Packet data itself.

I am using my own written code to acces various registers of W5300 and not the 8 bit driver provided by wiznet as my controller does not have external bus inteface so i use GPIO to acces the Wiznet bus.

Thank you , i will again look in to the wiznet driver for which you have sent a link.

Hitesh

Hi,
You can replace WIZnet driver’s IINCHIP_READ/WRITE & IINCHIP_READ/WRITE_BUF function with your GPIO functions.

In WIZnet driver, socket() function configures Sn_MR_ALIGN with flag option argument.

If you didn’t set Sn_MR_ALIGN after reset, You can use both odd & even data to be indicated by DATALEN in PACKINFO.

Thank you.