Hi
I am working on a project with an Atmel ATxmega256A3BU communicating over SPI with a WIZNET850io module (W5500 chip).
I use the WIZNET library to communicate with the W5500.
The problem is that I can not read back my settings, e.g. MAC or IP address.
I always get 0x00.
Only if I read the chip version from address 0x0039 I get 0x28.
Checked all the SPI signals with an oscilloscope and it looks OK. For tests I added also some small capacitors to SCS, SCKL and MOSI to be sure there are no glitches with the same result.
Tested it with 3 new 850io modules and it is the same with all 3.
I also reduced the test code to write just to some memory addresses and read it back.
Also if I read back the RETRY TIME Reg. I get 0x0000 but the default value should be 0x07D0.
Here is my test code
//*****************************************
/* simple initialization of WIZ550io for tests /
//****************************************
uint8_t mac = {0x00, 0x11, 0x00, 0x11, 0x00, 0x11};
uint8_t sn = {255,255,255,0};
uint8_t Ch_Version; /* for WizChip Version /
uint8_t WizRTR[2] = {0,0}; / for WizChip Retry Time RTR */
spi_init_ETH (); /* SPI Bus init. */
//*****************************************
/* WIZ550io init. /
//****************************************
SPI_SS_OFF_ETH; /* deactivate CS of WIZ850 /
WIZ_RESET(TRUE); / RESET WIZ850 is activated /
_delay_ms (5); / in WIZ850 datasheet min 0.5ms /
WIZ_RESET(FALSE); / RESET WIZ850 is deactivated /
_delay_ms (70); / in WIZ850 datasheet min 50ms */
reg_wizchip_cs_cbfunc(wizchip_select, wizchip_deselect); /* set the SPI functions /
reg_wizchip_spi_cbfunc(wizchip_read, wizchip_write); / set the SPI functions */
WIZCHIP_WRITE_BUF(0x000900, &mac, 6); /* write 6 Byte MAC address /
WIZCHIP_WRITE_BUF(0x000500, &sn, 4); / write 4 Byte Subnet Mask /
_delay_ms (10);
WIZCHIP_READ_BUF (0x000900, &mac, 6); / read 6 Byte MAC address /
WIZCHIP_READ_BUF (0x000500, &sn, 4); / read 4 Byte Subnet Mask /
WIZCHIP_READ_BUF (0x001900, &WizRTR, 2); / read 2 Bytes Retry Time Value Register /
WIZCHIP_READ_BUF (0x003900, &Ch_Version, 1); / read 1 Byte W5500 Chip Version Register */
Here the oscilloscope pictures:
(channel 1: yellow = CS, channel 2: cyan= MOSI, channel 3: magenta =CLK, channel 4: green = MISO)
Write MAC address ( 0x00, 0x11, 0x00, 0x11, 0x00, 0x11) to W5500 address 0x0009, variable length mode
MISO shows the debug information for the 2 address and the command byte but at the 3th, 4th and 5th byte I see it again.
Read back the MAC from address 0x0009, result is always 0x00
Write the Subnet Mask (255 255 255 0) to address 0x0005
Read back the Subnet Mask from address 0x0005, result is always 0x00
Read the RETRY Value Reg from address 0x0019, result is always 0x00
Read the the chip version from address 0x0039, result is 0x28, should be 0x04
Thanks for your help!
Rami