---
title: "random value in Sn_TX_RD"
url: "https://maker.wiznet.io/forum/13710"
markdown_url: "https://maker.wiznet.io/forum/13710/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Giorgi Tsintsadze"
created: "2020-02-18T13:40:56+09:00"
last_activity: "2020-02-20T01:02:45+09:00"
language: "en"
views: 720
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# random value in Sn_TX_RD

## Question

Asked by Giorgi Tsintsadze on 2020-02-18 in Ethernet Chips.

So I have TCP connection with server but I cannot send data properly:

This is how I send data:
TX_write_pinter[0] = 0x05;
TX_write_pinter[0] = 0x00;
SpiWriteRegister(0x0000, 2, transmit_buffer, 5);
SpiWriteRegister(0x0024, 1, TX_write_pinter, 1);
SpiWriteRegister(0x0001, 1, SEND, 1); //command register receive;

first argument is address and second is block address.
third is buffer and fourth is size.

So, first Tx buffer address is gonna be 0x0000 so I do not read it
then I write data in TX buffer
then I write new data size in TX_Write_Pointer
then I do SEND command;

but when I read TX_Read_pointer it gives me back strange values like 0x3060.

While I execute this code server receives this:!
[image|690x351](https://maker.wiznet.io/forum/legacyFile.asp?path=sPo8W9bLRn0eSGWAtShNw3IaWVC.png)
Which is obviously nothing close that I try to send.

what could be the problem ? I think I mess up with TX_Read_Pointer.
After Send command when I read TX_Write_Pointer it gives me back correct value

## Replies

### Reply 1 by becky, 2020-02-19

![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/0/0e96353f2161b1a7b6e87c7b44d08c8b5d93335e.png)
The procedure for sending data is as above.
You must first read the address via TX_WR and write the data to that address.

Please refer to ioLibrary Driver code.

[github.com](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/W5500/w5500.c)

#### [Wiznet/ioLibrary_Driver/blob/master/Ethernet/W5500/w5500.c](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/W5500/w5500.c)

```
//*****************************************************************************
//
//! \file w5500.c
//! \brief W5500 HAL Interface.
//! \version 1.0.2
//! \date 2013/10/21
//! \par  Revision history
//!       <2015/02/05> Notice
//!        The version history is not updated after this point.
//!        Download the latest version directly from GitHub. Please visit the our GitHub repository for ioLibrary.
//!        >> https://github.com/Wiznet/ioLibrary_Driver
//!       <2014/05/01> V1.0.2
//!         1. Implicit type casting -> Explicit type casting. Refer to M20140501
//!            Fixed the problem on porting into under 32bit MCU
//!            Issued by Mathias ClauBen, wizwiki forum ID Think01 and bobh
//!            Thank for your interesting and serious advices.
//!       <2013/12/20> V1.0.1
//!         1. Remove warning
//!         2. WIZCHIP_READ_BUF WIZCHIP_WRITE_BUF in case _WIZCHIP_IO_MODE_SPI_FDM_
//!            for loop optimized(removed). refer to M20131220
```

This file has been truncated. [show original](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/W5500/w5500.c)

### Reply 2 by Giorgi Tsintsadze, 2020-02-19 (in reply to reply 1)

instead of initial value (0x0000) I get some weird values and thats the problem. The values I get are above my TX buffer free size limit

---

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