---
title: "Getting wrong data on receive with wiz550io"
url: "https://maker.wiznet.io/forum/14580"
markdown_url: "https://maker.wiznet.io/forum/14580/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "jallaballa"
created: "2022-06-16T12:41:19+09:00"
last_activity: "2022-06-20T06:22:08+09:00"
language: "en"
views: 499
replies: 3
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Getting wrong data on receive with wiz550io

## Question

Asked by jallaballa on 2022-06-16 in Ethernet Chips.

Good afternoon!

I’m interfacing a wiz550io with a msp430 (msp430f2416). I’ve set up SPI on the MSP as follows:

- MSB

- 8 bit

- Clock polarity inactive low

- Clock phase: Data is captured on the first clock edge and changed on the following edge.

- speed is ~1MHz

my main loop goes approximately like this:

> RST pin low for ~1 sec
> RST pin high for ~0.5sec
>
> reg_wizchip_spi_cbfunc(spi_readbyte, spi_writebyte);
> reg_wizchip_cs_cbfunc(spi_cs_on, spi_cs_off);
>
> rb = getVERSIONR();
> printf(“version nr %x\n”, rb);
>
> wiz_NetInfo netInfo;
> wiz_NetInfo netInfo2 = { .mac = {0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, // Mac address
> .ip = {2, 2, 2, 2}, // IP address
> .sn = {3, 3, 3, 3}, // Subnet mask
> .gw = {4, 4, 4, 4}}; // Gateway address
> wizchip_setnetinfo(&netInfo2);
> wizchip_getnetinfo(&netInfo);
> printf(“IP: %i %i %i %i\n”, netInfo.ip[0], netInfo.ip[1], netInfo.ip[2], netInfo.ip[3]);

My results are:

> version nr 2
> IP: 2 3 0 192

Why is version number wrong? (Should be 0x04)
Why are IP numbers way off?

SPI is tested to work correctly when i connect MOSI directly to MISO and send various dummy bytes.

I’ve scoured this forum and else where and simply do not see what is missing.

Hoping for a quick reply! Thanks in advance!

## Replies

### Reply 1 by irina, 2022-06-20

You should operate the reset operation before link status of wiz550io confirm it.
operation is approximately like this:
spi_cbfunc → spi initailize → reset operation → confirm the link status → register read/write

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/7/7b05ad97622134f62df370fbd732b907a59539e6.png) image651×748 24.9 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/7/7b05ad97622134f62df370fbd732b907a59539e6.png)

### Reply 2 by jallaballa, 2022-06-20

Thank you Irina, is it possible to get a link to the code base you have imaged in your reply?

### Reply 3 by irina, 2022-06-20 (in reply to reply 2)

I shown you it that capture the file of main.c
<https://github.com/WIZnet-ioLibrary/W5x00_Loopback_with_W5100S_EVB/blob/master/TrueSTUDIO/W5x00_loopback/src/main>.

Below is a github link that includes main.c.

![](https://github.githubassets.com/favicons/favicon.svg) [GitHub](https://github.com/WIZnet-ioLibrary/W5x00_Loopback_with_W5100S_EVB)

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/6/6f8a064859e672c745677d67eb3146f1edff28da.png)

### [GitHub - WIZnet-ioLibrary/W5x00_Loopback_with_W5100S_EVB: This Project is...](https://github.com/WIZnet-ioLibrary/W5x00_Loopback_with_W5100S_EVB)

This Project is base on W5100S-EVB. but If you use the SPI of Arduino interface on W5100S-EVB, you can use the W5100S/W5100/W5200/W5500 when wizchip_conf.h modify - GitHub - WIZnet-ioLibrary/W5x00_...

---

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