I am currently trying to use the w5500 chip (wiz850io) for ethernet communication using SPI. I am having issues setting the network configuration. When I read and write MISO only outputs 0x01 0x02 0x03. Is this the correct output for both reading and writing?
uint8_t txsize[8] = {2,2,2,2,2,2,2,2};
uint8_t rxsize[8] = {2,2,2,2,2,2,2,2};wiz_NetInfo netInfo = { .mac = {0x00, 0x08, 0xdc, 0x1d, 0x29, 0xd7}, // Mac address
.ip = {192, 168, 1, 36}, // IP address
.sn = {255, 255, 255, 0}, // Subnet mask
.gw = {192, 168, 1, 1}, // Gateway address
.dns = {8, 8, 8, 8}, // DNS server
.dhcp = NETINFO_STATIC }; // DHCP enable / disableuint8_t Ch_Version;
SpiIf_ChConfig GETchConfig;
wiz_NetInfo getnetInfo;
int8_t phy_link =0;
void w5500_Init(void)
{
/* W5500 Chip Reset*/
IfxPort_setPinLow(&MODULE_P02,6);
delay_cnt(5000);
IfxPort_setPinHigh(&MODULE_P02,6);
delay_cnt(10000);reg_wizchip_cs_cbfunc(cs_sel, cs_desel); reg_wizchip_spi_cbfunc(spi_rb, spi_wb); reg_wizchip_spiburst_cbfunc(spi_rburst, spi_wburst); delay_cnt(10000); wizchip_init(txsize, rxsize); do{//check phy status. if(ctlwizchip(CW_GET_PHYLINK,&phy_link) == -1){ printf("Unknown PHY link status.\r\n"); delay_cnt(10000); } }while(phy_link == PHY_LINK_OFF); wizchip_setnetinfo(&netInfo); delay_cnt(10000); wizchip_getnetinfo(&getnetInfo); Ch_Version = WIZCHIP_READ(VERSIONR);
}
Here are my logic analyzer outputs for writing and reading the MAC address.
Writing:
Reading:
Reading VERSIONR = 0x01
I am new to implementing these modules so any help on where I have gone wrong or what my next steps should be would be appreciated.