W5500 wrong Versionr; communication problem

Hey all

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.

DIMMER01|690x444
https://www.bilder-upload.eu/bild-0aaa1d-1551888270.png.html

Can someone please help me, I can’t figure out what the problem is.

Many thanks in advance
-Kira

Did you perform the proper reset procedure (toggle rst pins for the documented times) and soft reset (write 128 to MR and wait till lear) after?

1 Like

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)

2 Likes

You must be correct. Most probably @kira used datasheet of another device (e.g. W5100).

Maybe the device model is not correctly configured in the API?

Oh lot of thanks guys!

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

1 Like

Yep, that was the problem. Thank you very much Philipp_K for your help, now I get the right version number.