---
title: "WIZ850io TCP Server data sending mistake"
url: "https://maker.wiznet.io/forum/14140"
markdown_url: "https://maker.wiznet.io/forum/14140/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "HPMaster82"
created: "2021-02-03T23:35:58+09:00"
last_activity: "2021-02-10T10:08:50+09:00"
language: "en"
views: 421
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# WIZ850io TCP Server data sending mistake

## Question

Asked by HPMaster82 on 2021-02-03 in Ethernet Chips.

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:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)

## Replies

### Reply 1 by irina, 2021-02-07

Do you use the iolibrary- driver we provide?

![](https://github.githubassets.com/favicons/favicon.svg) [GitHub](https://github.com/Wiznet/ioLibrary_Driver)

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/1/17f66f2e9c27f9749e7af3ad7efe15d9492bea3b.png)

### [GitHub - Wiznet/ioLibrary_Driver: ioLibrary_Driver can be used for the...](https://github.com/Wiznet/ioLibrary_Driver)

ioLibrary_Driver can be used for the application design of WIZnet TCP/IP chips as W5500, W5300, W5200, W5100 W5100S. - GitHub - Wiznet/ioLibrary_Driver: ioLibrary_Driver can be used for the applica...

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

### Reply 2 by HPMaster82, 2021-02-10 (in reply to reply 1)

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 &lt;&lt; 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…

---

Source: https://maker.wiznet.io/forum/14140
