---
title: "W5500 Fixed Data Mode"
url: "https://maker.wiznet.io/forum/14291"
markdown_url: "https://maker.wiznet.io/forum/14291/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "basjot"
created: "2021-07-14T17:09:31+09:00"
last_activity: "2021-07-19T07:41:05+09:00"
language: "en"
views: 516
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 Fixed Data Mode

## Question

Asked by basjot on 2021-07-14 in Ethernet Chips.

Hello,

I have recently desinged 5 pic pcb boards with STM32F103 and W5500 chip for TCPIP connection. Unfortunately, I didn’t mind that there is no Library for FDM mode and I have tied SCSn pin to the ground via 10kOhm resistor. I am trying to modified the reference code for write/read functions but the chip does’t work properly. For example, when I write mac address and read it back, it seems like the chip register is storing only the last value. Below you will find the mofication code for FDM 1 byte. Have you any idea what I am doing wrong?

void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len)
{

WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
AddrSel |= (*W5500_SPI_WRITE* | *W5500_SPI_FDM_OP_LEN1*);

if(!WIZCHIP.IF.SPI._write_burst) // byte operation
{
for(i = 0; i &lt; len; i++)
{

```
	WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF0000) >> 16);
	WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >>  8);
	WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >>  0);
	AddrSel += (1 << 8);
		WIZCHIP.IF.SPI._write_byte(pBuf[i]);
   }
```

}
…

## Replies

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

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/8b2be84e6345b3b833ddc493a462c7d2587d2d48.png) image673×690 75.5 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/8b2be84e6345b3b833ddc493a462c7d2587d2d48.png)

I think I know that FIXED mode works when it is configured as shown in the picture above.

```
AddrSel += (1 << 8);
WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF0000) >> 16);
WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >>  8);
WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >>  0);
for(i = 0; i < len; i++)
```

{
WIZCHIP.IF.SPI._write_byte(pBuf[i]);
}

I think

### Reply 2 by basjot, 2021-07-19

Hello. Thank you for your reply. Eventually, my code works properly. In your case, I think that AddrSel should increase every time you send a data byte to register as in my code.

---

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