So I got the W5500 which I am talking to from a dsPIC33E. Communication is over SPI.! I use the wizet ioLibrary(GitHub - Wiznet/ioLibrary_Driver: ioLibrary_Driver can be used for the application design of WIZnet TCP/IP chips as W5500, W5300, W5200, W5100 W5100S.). To do simple tests , I call the WIZCHIP_READ_BUF() function with 0x0039, which should get me the version number(0x04). But I get 246decimal. Please See screenshot from my oscilloscope. Everything is right , even the byte counter on the MISO Line which I’ve read in another topic on this site. But can’t figure out why I don’t get the 0x04.
My SPI Parameters:
clock idle high
falling edge
Even when I try other combinations I never get the 0x04.
Correct me if I’m wrong, but shouldn’t the 0x39 be in the second byte after CS goes low? Like this:
0x00 0x39 0x00 0xXX
(2 Bytes Adress, 1 Byte Control Phase, 1 Dummy Byte for the response)
I could not test it yet, but I’m sure it would work with your solutions.
Candela12: I do the proper Hard reset(rst), but did’nt the Soft reset…need to do that of course!
Also Philipp_K mentionend a great point: of course I sent one 0x00 too much. I did not paid attention that the WIZCHIP_READ_BUF() sends three bytes.
I will come back to you when I can test it again.
Many thanks
Have good one
-kira
I think I see your problem now. The WIZCHIP_READ_BUF() function expects the combination of adress and opcode, especially because the opcode also contains the register block you want to read from. Since you only need one byte, calling WIZCHIP_READ(0x003900) should yield the correct result.
Though strongly suggest calling getVERSIONR() instead; if you’d prefer using WIZCHIP_READ, i’d still recommend looking at the implementation of getVERSIONR(), that might give you an idea how those functions work