Getting wrong data on receive with wiz550io

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!

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

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

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.