[From QnA]problem in data transmission using w5300

hi
I use w5300 to sent data to pc by 16bit mode; in the data transmission i find that sometimes the data will be error, for example i using w5300 sent 32 bit float data “41 c7 c8 70"to pc;but when pc received,it become “ff c7 c8 70”; every time the erroe happen,the” 41" become to “ff”

expecting your reply

Dear customer,
Thanks for your interest in W5300.
Do you use our reference code(16bit access)?

Could you please tell me detailed information?

  • What kind of MCU do you use?
  • When receive operate, please let me know how operate it.
    value of Sn_SSR, Sn_IR, Sn_IMR, IR, IMR, MR etc….
    Thanks,
    WIznet

thanks for your reply

I use reference code(16bit access),   using TMS320F28335 as my MCU; using port 0 to sent and receive data; when i sent data from MCU to PC,  the register value 

IMR=0x0001;
MR=0xB800;
S0_MR=0x0001;
S0_IMR=0x0014;
S0_SSR=0x17 // established;
IR=0x00;
S0_iR=0x00;

every time i sent 6785 byte data from MCU to PC; most of times ,it works well; but occasionally the error will be happen, some byte will become to “ff”

Dear customer,
Thanks for your interest in W5300.
Try to modify the recv function. For example,
In case of If statement in recv function.
Please remove the If statement. Timing problem can occur by If statement.
======== 16bit reference code in recv function==============
wiz_read_buf(s,(uint8*)&pack_size,2); // extract the PACKET-INFO(DATA packet length)
if( ((vint16)MR) & MR_FS ) → remove…(if you use MR_FS, try to remove if statement)
pack_size = ((((pack_size << 8 ) & 0xFF00)) | ((pack_size >> 8)& 0x00FF));
thanks,
WIznet

[quote=“hjjeon0608”]Dear customer,
Thanks for your interest in W5300.
Try to modify the recv function. For example,
In case of If statement in recv function.
Please remove the If statement. Timing problem can occur by If statement.
======== 16bit reference code in recv function==============
wiz_read_buf(s,(uint8*)&pack_size,2); // extract the PACKET-INFO(DATA packet length)
if( ((vint16)MR) & MR_FS ) → remove…(if you use MR_FS, try to remove if statement)
pack_size = ((((pack_size << 8 ) & 0xFF00)) | ((pack_size >> 8)& 0x00FF));
thanks,
WIznet[/quote]

or you could try as follows:
in the beginning of the recv(),
you add & modify the code :

uint16 tmp_MR = (*(vint16*)MR); // read MR register first // and then, you use tmp_MR whenever you use MR register in revc() function.