I have integrated the W5500 into several projects without issue, however in a new PoE capable project I cannot get the W5500 to get a PHY Link (PHYCFGR register LINK bit is 0). I have tried using the PMODE we usually use (the default 111 All capable, Auto-negotiation enabled) but received no PHY Link. I also tried setting the OPMDC and OPMD bits (with the correct resetting of the PHY) and cannot get a PHY link even with auto-negotiation turned off. I have attached the schematic of the PCB. We have used the Magnetics->W5500 schematic before successfully in our other projects, so I suspect there is something going on between the Cable->Magnetics. Any suggestions? The magnetics used is the H2019NL. The Ethernet connector is non-standard pinout, but I have confirmed that the RJ-45 pins match on the PCB. I have tried with a cross-over and a straight cable going into a switch with no luck.
W5500 Schematic.pdf (90.6 KB)
Hi.
PHY link is hardware area.
So, you should checking schematic & artwork.
And refer to below two schematic.
- W5500 reference schematic.
- WizArduino Schematic.
WizArduino Schematic is using PoE. please MD1 and RJ-45 checking.
I have a few more question.
What is 21033814802? It is ethernet connector??
please datasheet give me.
Thank you
Hi,
Same issue here.
PCB designed according to ref. schematics, produced in factory
Plug in w5500 to Cisco switch, link does not come up
But when I disable Auto-negotiation on Cisco switch, port is UP. This is on 100Mbit port, and on 1Gbit port, I need to disable Auto-negotiation and manually set port speed to 100Mbit.
This is happening on different Cisco switches, 2960 series and SF-300 series
Thing is that I cannot un-solder resistor to disable auto-negotiation on pcb since it is resistor array
Can I disable auto negotiation in code, regardless of resistors connected?
I have red that PHYCFGR should be changed but I am not sure where
This is section from w5500.h:
__GP_REGISTER8 (PHYCFGR, 0x002E); // PHY Configuration register, default value: 0b 1011 1xxx
w5500 datasheet on page 43 states:
PHYCFGR (W5500 PHY Configuration Register) [R/W] [0x002E] [0b10111XXX]
But I am stuck hereā¦
Any assistance is appreciated
Thanks in advance
Why not just to try it? Datasheet says that if you set bit 6 into 1, you can override PMODE input pins settings.
For example, for 100MBit no auto-neg you write 0b1_1_011_000 (0xD8) into this register.
Thats what I am trying to figure out nowā¦ (maybe this post will help some dummy like meā¦)
According to datasheet and code from w5500.h folowing is set
__GP_REGISTER8 (PHYCFGR, 0x002E); // PHY Configuration register,
Default value: 0b 1011 1000
1 - RST - 7 bit - No Reset (0 RESET)
0 - OPMD - 6 BIT - 0: Configure with the H/W PINs(PMODE[2:0]) 1: Configure with OPMDC[2:0] in PHYCFGR
1 - OPMDC- 5 bit -
1 - OPMDC- 4 bit - 111: All capable, Auto-negotiation enabled
1 - OPMDC- 3 bit -
0 - DPX - 2 bit - Duplex Status [Read Only] -
0 - SPD - 1 bit - Speed Status [Read Only]
0 - LNK - 0 bit - Link Status [Read Only]
I need to set sixth bit to 1 so my settings would be: 0b 1101 1000 (HEX:0xD8 - DEC:216)
1 - RST - 7 bit - No Reset (0 RESET)
1 - OPMD - 6 BIT - 0: Configure with the H/W PINs(PMODE[2:0]) 1: Configure with OPMDC[2:0] in PHYCFGR
0 - OPMDC- 5 bit -
1 - OPMDC- 4 bit - 011: 100BT Full-duplex, Auto-negotiation disabled
1 - OPMDC- 3 bit -
0 - DPX - 2 bit - Duplex Status [Read Only] -
0 - SPD - 1 bit - Speed Status [Read Only]
0 - LNK - 0 bit - Link Status [Read Only]
Now comes the tricky part that I am not sure about, where to write this value?
So far it seems that Ethernet2.cpp could be a good place to put it, when ethernet is initialized:
Declare new variable:
static const uint8_t myPHYCFGR = 0xD8;
void EthernetClass::begin(IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
{
w5500.init();
Set PHY configuration before or after init?
w5500.setPHYCFGR(myPHYCFGR);
w5500.setIPAddress(local_ip.raw_address());
w5500.setGatewayIp(gateway.raw_address());
w5500.setSubnetMask(subnet.raw_address());
_dnsServerAddress = dns_server;
}
Am i looking into right direction?
Thank you in advance
I think you should do it after init because this init routine may software-reset chip, and this setting will get reset too. Leave as you have it now for first test.
Seems like this doesnt work
Thing is that I am not sure if I am doing it right, if declaration is correct
Tried to edit Ethenet2.cpp
w5500.init();
w5500.setPHYCFGR(0xD8);
w5500.setIPAddress(local_ip.raw_address());
But nothing changes, like I did nothing
Tried also to setPHY before init, same thing
To prove that you have this setting effective you can read this register any time and check that it is still 0xD8. Do it just before you start your main code, and make some signal (e.g. turning LED on) if it is not 0xD8. I assume you tried different network cables and cable is not an issue?
thx for suggestion, good point
I will try to make function that will return register value to confirm that Im actually changing value
Cables are not an issue. Tried with any combination of straight/crossover, lenghts 1-3m
I have found that some switches have auto-negotiation compatibility issues with some of devices
For example, one of the Cisco switches have big list of devices with compatibility issues:
[url]http://www.cisco.com/c/en/us/support/docs/switches/catalyst-6500-series-switches/17053-46.html[/url]
It describes that āDuplex Mismatchā will sometimes happen when client side is configured in Auto mode.
There are different configurations when issues can happen, AUTO<>100Mbit, 100Mbit<>1000Mbit, etc.
This makes me thinking that DIP switches could be better option for setting link mode instead of soldered resistors?
This is good idea if you expect device being used with such switches. However you may also think about having it configured with software, connecting these W5500 configuration pins to MCUās output pins which are software-configured.
Hm,
Again good thinkingā¦
I can store 3-bits into EEPROM and set PHY mode on boot
Anyway I have web page for other unit setting.
Worst case scenario, connect unit directly to PC and configure PHY. Save settings and plug into network switch
Need to test if this worksā¦
Some update regarding this issueā¦
Managed to change PHY setting of chip but no luck getting link up
After begin section of arduino code ( before begin does not work!) Iāve added following code
Ethernet.begin(mac, ip, gateway, gateway, subnet);
w5500.setPHYCFGR(208); ā tried different values, speed, auto-neg on/off
When I connected unit to port which has Auto-negotiation disabled, link comes up
I was able to read current PHY setting of chip with following command:
w5500.getPHYCFGR();
Output values were correct, meaning that I have manage to change PHY value bit Link does not come up on port with Auto-negotiation enabled
I am back to beggining
Seems like unsoldering resistor will not help eitherā¦
Any suggestions???
208 is 0xD0, which is ā100BT Half-duplex, Auto-negotiation disabledā, while auto-negotiation disabled anyway.
Next step I would take - set OPMDC to 10 MBit, set switch port to 100 Mbit, and checked if switch port switches to 10 MBit to match W5500 speed. This way we will at least know what this register has partial functionality - forces 10 MBit over the network cable.
I did tests that you proposed but no luck
Both results are the same:
Auto-Negotiation DISABLED <> w5500.setPHYCFGR(192); (000: 10BT Half-duplex, Auto-negotiation disabled)
Auto-Negotiation DISABLED <> w5500.setPHYCFGR(200); (001: 10BT Full-duplex, Auto-negotiation disabled)
Switch reports 100Mbit port speed
On Gigabit port, when I set port speed on 1000Mbit, link is down
Changing port speed to 10 or 100Mbit gives link up. Of course, Auto-neg must be turned off
If i didnt mention before, switch is Cisco SF302-08, my colleague said that he couldnāt bring communication on Cisco 2960X Gigabit switch (all gigabit ports)
Did addiitonal test with Cisco ASA 5505 router with strange results:
W5500 PHY settings to 10Mbit and 100Mbit Auto-negotiation disabled - Link down!!
W5500 PHY default settings: 100Mbit Auto-negotiation Enabled - Link UP!!
No changes made on ASA, so ports are configured as default - probably Auto-Negotiation ON
Seems like this is related to switch/router model
I will try with Cisco 2960 which has more detailed debug log, maybe I will get some info from switch side
Hey MexxMe.
I was also dealing with PHY-Op-Mode a while ago and as far as I remember one has to reset the PHY, not the entire chip, after making changes to OPMD and OPMDC.
You wrote:
[quote]void EthernetClass::begin(IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
{
w5500.init();
Set PHY configuration before or after init?
w5500.setPHYCFGR(myPHYCFGR);
w5500.setIPAddress(local_ip.raw_address());
w5500.setGatewayIp(gateway.raw_address());
w5500.setSubnetMask(subnet.raw_address());
_dnsServerAddress = dns_server;
}[/quote]
Do you have a PHY reset routine inside your w5500.setPHYCFGR(myPHYCFGR) function?
The datasheet says for OPMD:
[quote]ā¦ If user wants to re-configure with
OPMDC[2:0], it should reset PHY by setting the RST bit to ā0ā after
the user configures this bit as ā1ā and OPMDC[2:0].
[/quote]
The thread opener also mentioned it
I remember adding a delay of 200 ms after reset before setting PHYCFGR[7] to 1.
@bfeigum
Is your initial problem solved?
I do have an arduino Uno + Ethernet Shield 2 + PoE add-on Board and it works out of the box.
Maybe this can give you a hint.
thx for suggestion Skyfox,
I didnt reset chip after changing OPMD setting, neither setPHYCFGR function has reset routine
Tried to read value after some time and getPHYCFGR returned correct value so I thought that new setting is applied
Will try with resetting chip and adding some delay
BTW found some post by hkjung on Korean, explaining how to reset chip, can be useful to somebody (like meā¦)
Google translate:
[quote]
It is easy to set PHY mode of W5500 in the following order.
Let a and b be the mode entry method of each and check the test.
A. When entering Power Down mode
// Power down mode setting
(1) Power down mode bit setting (set, 1) of register using setPHYCFGR ()
// Perform PHY reset
(2) Reset enable bit setting (PHY reset performed, corresponding bit set, 1) using setPHYCFGR ()
(2) Reset enable bit clear (PHY reset bit clear, 0) using setPHYCFGR ()
B. When returning to Normal mode in Power Down mode
// Power down mode setting
(1) Power down mode bit clear (clear, 0) of register using setPHYCFGR ()
// Perform PHY reset
(2) Reset enable bit setting (PHY reset performed, corresponding bit set, 1) using setPHYCFGR ()
(2) Reset enable bit clear (PHY reset bit clear, 0) using setPHYCFGR ()[/quote]
I am also currently gathering data on this issue. I have a bunch of hardware data points.
Currently I have units that will auto-negotiate successfully and units that will not with various smart switches.
Cisco SG200-26 and Netgear GS728TP in particular.
Curious enough if the shield is connected to a dumb switch, Netgear GS108T or Cisco SLM2008, before the smart switch everything is fine.
Sometimes setting the smart switch port to 100M is enough to establish a connection.
Units being used are W5500 Ethernet Shield V1.0, Ethernet2 library v1.0.3, Arduino IDE v1.8.1
4x Lot number 1636, chipset D9F377 1621, fail to connect
3x Lot number 1625, chipset D85127 1613, 1 fail, 1 works, 1 one works with 728TP, but not SG200-26
3x Lot number 1616, chipset D7P691 1522, 2 work, 1 fail
I have another 40 some units of the 1636 Lot and am hoping this is not a trend. All development was done based on a working Lot 1616 board.
I am hoping someone has some insight on this as sifting through what works and doesnāt work is going to be a disaster. It looks like the chipset is capable of being compatible with these switches, but I cannot find any common cause for failure.
Same is here, while with another chip, W5100. Recently had issues with Arcadyan device. Symptom is that speed LED is blinking (instead of being steady on or off) when cable is connected. Solution - put dumb hub in between.
After some more trial and error this seems to be an auto-negotiation issue. I cannot seem to find any standard that the W5500 follows.
My impatience resulted in false data being reported. Link establishment time seems to be very erratic. Time to link can vary from 1-70 seconds.
This time is connection independent. I can plug into the same port multiple times and have different link times every time.
Forcing the w5500 to 100M full duplex does not seem to improve the randomness of this time to link interval.
At this point I cannot determine which device is at fault as I donāt know what auto-negotiation protocol the w5500 follows and this is all just theory.