Wiz850IO and PHYCFGR register

Status
Not open for further replies.

jpatrick62

Well-known member
Wanted to know if anyone else has run into this issue using the Wiz850IO network module. On the Wiznet site, they specify that the 850 uses the W5500 chip which
they describe as TCP/IP hardwired chip and PHY embedded. So getting things like link state/speed/duplex info should be rather straightforward and in fact, if I query
the Wiz850IO module just after setup but prior to communications with a client, everything works great and I get all the info requested. However, after I first start handling
clients, code like that shown below fails to work.


Code:
uint8_t GetControllerLinkStatus()
{
	if (bitRead(w5500.getPHYCFGR(), 0))
		return 1;
	else
		return 0;
}

Basically, the w5500.getPHYCFGR() read returns all 8 bits as zero. Since calls to w5500.getPHYCFGR() work perfectly well prior to handling clients, I'm stumped as to the cause
of this. As getting link status information is most helpful while in production, I'd really like to find an answer to this. From the Wiz5500 data sheet:

Bit Symbol Description
-------------------------------------------------------------------
2 DPX Duplex Status [Read Only]
1: Full duplex
0: Half duplex

1 SPD Speed Status [Read Only]
1: 100Mpbs based
0: 10Mpbs based

0 LNK Link Status [Read Only]
1: Link up
0: Link down

Should I only make the w5500.getPHYCFGR() call after the WIZ sets an interrupt from the INTn pin?
 
The forum rule requests you provide a working sketch that demonstrates the problem. I don't know what Ether lib you are using. I used the Teensy Ethernet library with a w5500, and i get 0xbf when reading the PHYCFGR location 0x002E from the common register area of the wiz5500 chip, using W5100.read() from the Teensy Ethernet lib. I get 0xbf on startup and after/before UDP read/writes and TCP client or server activity. Works for me.
 
Thanks for the response Manitou. I was using the Teensy Ethernet library as well, so I'll try it your way and see what happens - thanks!
 
Thanks for the response Manitou. I was using the Teensy Ethernet library as well, so I'll try it your way and see what happens - thanks!

Strange. Your code snippet uses w5500.getPHYCFGR(). I don't find that in the Teensy Ethernet library. I did google it, and it appears in Ethernet2 lib and some wiznet libs.
 
Yeah, I used those functions from the w5500.h and w5500.cpp files I got from Ethernet2/3 library I believe. I used that since the W5500 chip is used on the 850IO network module. Like I said, it
works only after initializing the module, then repeated requests for information fails.
 
Status
Not open for further replies.
Back
Top