WIZ850io TCP Server data sending mistake

Hello everyone,

I hope you will can help in solving of my problem.
I handle a Wiz850io module in TCP Server mode. I thought that I handle the transmisson well, but revealed that I just thougth that.
My problem is, that I can receive the incomind data from clients well (in ONE packet) but if I send any length data, in the ethernet it will send 1byte mode. Byte to byte, not in one packet.

I handle the sockets inVDM mode so I do not understand, what could be the reason of this operation…

Can anybody help me?
Please, just ask from me any more information for the soonest solving of this situation :slight_smile:

Do you use the iolibrary- driver we provide?

VDM mean that data Length is controlled by SCSn.
Do you control the SCSn for data length?

Hello Irina,

Yes, the SCSn pin is controlled by me, because on the bus I handle some port extender chips too.
The language what I use is the LunaAVR, so I had to write the routines for myself.
Here is the write routuine, as I handle the sending:

Procedure WriteStr(SendData as string, sid as byte)
// The ‘sid’ is the Socket ID
dim length, i as word
dim TX_RDptr, TX_WRptr as word
dim status as byte

length = len(SendData) // The length of the send data string

status = readSnSR(sid)
TX_RDptr = readSnTX_RD( sid )
TX_WRptr = getTXWR_VirtualAddress( sid )

CSACTIVE // Go to SCSn pin to LOW state

Spi.Master.WriteByte TX_WRptr.highbyte
Spi.Master.WriteByte TX_WRptr.lowbyte

ControlByte = (sid << 5) or 0x14
Spi.Master.WriteByte ControlByte

for i = 1 to length
Spi.Master.WriteByte ( SendData.bytevalue(i) )
next

CSPASSIVE // Go SCSn pin to HIGH state

TX_WRptr = TX_RDptr + length
writeSnTX_WR(TX_WRptr, sid)

writeSnCR(SnCR_SEND, sid)

endproc

In my opinion, this routine should works well, so the mistake can be in an other routine or I set a register wrong. Can it be possible?

All characters of the SendData will be send, just in a one-character length packet…