0
\$\begingroup\$

My design includes an STM32, a W5500 and this RJ45 connector which has a 1000pF/2kV capacitor.

The problem is that when I connect a cable to the RJ45, the orange LED always blinks. This indicates no link is established.

If I read link status bit in while(1) loop from W5500, this is always changing as "Link Up", "Link down", "Link up" ....

This is my schematic:

enter image description here

This is a picture of the PCB:

enter image description here

This is the layout of the PCB design:

enter image description here

Crystal used in the design.

I've connected a 0 ohm resistor in place of capacitor C16 since the RJ45 connector already has it.

This is the recommended design by wiznet

enter image description here

Differences that I can see:

  1. Ferrite bead between VDD and VDDA
  2. Careless impedence matching on RX-TX lines
  3. 1Mohm crystal resistor not installed

What is the root cause of this problem and how can I debug it to solve the problem?

\$\endgroup\$
6
  • \$\begingroup\$ Don't know if it is bad enough that it should cause immediate failure, but it looks to me like you are treating those Rx/Tx lines nothing like high speed differential signals in your layout, adding long stubs etc to them. \$\endgroup\$ Commented Feb 6, 2022 at 13:06
  • \$\begingroup\$ How can I see if treating differential lines to understand the problem? \$\endgroup\$ Commented Feb 6, 2022 at 13:13
  • \$\begingroup\$ It also looks like you have placed the bypass caps pretty far from the pins, this may be more serious than poor routing of Tx/Rx. Could it be that the chip actually resets every time it tries to establish a link, due to power failure? \$\endgroup\$ Commented Feb 6, 2022 at 13:23
  • \$\begingroup\$ If i solder big value capacitors to pins directly, Does it guide me? \$\endgroup\$ Commented Feb 6, 2022 at 13:50
  • \$\begingroup\$ The crystal may not oscillate properly at all if the bias resistor is missing. If you have multiple small issues then fix them or make sure they are not an issue one issue at a time. \$\endgroup\$ Commented Feb 6, 2022 at 17:40

3 Answers 3

3
\$\begingroup\$

Before even beginning, better formatting of your question is highly recommended. Arrange the links to a list, provide better quality pictures of the schematic and the PCB design, not just a picture with part of your PCB. Make it easier for the people providing help.

I'm sorry to say but your PCB is kinda on the poorly designed side of things. It has a lot to improve, and debugging the W5500's connection might not be something that can be done right away. So I'll provide you with some steps I would recommend taking.

First, I recommend that you take your time to improve both your schematic and PCB layout skills. Pretty schematic sheets not only look good but also prevents a lot of human errors. Not even to say about good PCB layouts. Below is some stuff I noticed which you'll need improvements on just a first glance.

  • PCB layout tips on high-speed traces including Ethernet signals
  • PCB layout tips with crystal oscillators
  • Maintaining better grounding paths
  • Placing of bypass capacitors, better power trace layout
  • After learning the above, you'll find out more stuff to learn.

After that, look for some references regarding W5500 designs. There are quite a lot of open-source designs you can refer to. Just looking through designs using the same parts will give you some ideas and some tips for yours too. I'll link some products with schematics and PCB layout data available.

By the time you've gotten to this stage, you'll start to see most of the things you've messed up. Unless we're talking gigabit, ethernet is actually quite robust despite its high-speed capabilities, and by just referencing and copying the designs from other people you should be able to get it working especially since you don't seem to have serious dimensional constraints.

Lastly below are some of the problems your PCB has right now. There's probably more, below is just from a quick scan of your PCB pic. I won't bother looking at your schematic unless you provide one with an easily-readable high-resolution one, ha.

  • RJ45 connector PCB layout constraints including copper keep-out area, component keep-out area
  • As @Klas-Kenny said, treating high-speed Ethernet traces like low-speed data lines
  • Is it your intent to ground 3 PMODE pins and cripple the chip's capability to 10BT Half-duplex, Auto-negotiation disabled when you could achieve 10/100 full-duplex, Auto-negotiation enabled with all 3 PMODE pins pulled up?
  • Not grounding RJ45 connector's CHS GND pin. It's recommended by the datasheet.
  • Poor power traces also with poor ground pours
\$\endgroup\$
7
  • \$\begingroup\$ You are right, but sometimes in life, we have to make designs very quickly in very tight times. At least it did for me. In very general terms, I have never liked comments that do not lead to a quick solution or narrow down the solution in a way that makes it easier. yes it's true all this should have been done but general and very theoretical statements. I think different interpretations should come in this situation to help, especially with experience and familiarity with similar problems.. \$\endgroup\$ Commented Feb 6, 2022 at 14:29
  • 1
    \$\begingroup\$ The Last part of my answer gave you some of the stuff that should be fixed based on your picture. Your schematic wasn't quite readable, and you didn't even provide screenshots of your PCB layout. Your PCB either has power or high-speed interference problems, or both. From my experience debugging hardware failures, you would save the most amount of time doing a redesign, I seriously think so. \$\endgroup\$ Commented Feb 6, 2022 at 14:56
  • \$\begingroup\$ I couldn't understand your comment about PMODE pins. I set these pins to HIGH to cover all possibilities. \$\endgroup\$ Commented Feb 6, 2022 at 18:42
  • \$\begingroup\$ I've narrowed down the problem a bit: When it performs unstable behavior, if I touch its reset pin with a wire or pull it to GND, it starts to work. where can I look for the problem with this hint? Because I need to find a temporary solution by modifying this card. Data lines? bypass capacitor? or where. Do you have a comment? \$\endgroup\$ Commented Feb 7, 2022 at 16:31
  • \$\begingroup\$ My bad on the PMODE pins, I assumed the copper pour was GND, not VCC. For your second comment, what do you mean by it 'works'? If it gains full functionality, just ground the RST pin and continue on? I can't make any guess just based on that cuz it's just another symptom of unstable behavior. It could be from data, power, clock, or something else. \$\endgroup\$ Commented Feb 8, 2022 at 4:14
3
\$\begingroup\$

Actually, it was not a perfect layout because of time limitations. This is the answer for a temporary solution: the reset pin of the W5500 wasn't connected to the microcontroller port, there was just a pull-up resistor connected to the reset pin. I've connected this pin using a small wire to an STM32 pin. When the circuit is powered up, I keep the reset pin low for about 200 milliseconds then I switch to high level as hard reset. I only solved this way for now.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Looking through my code for the W5500, I do have a somewhat ominous comment saying that It's wise to hold the W5500 in reset until everything else is initialized. I then even specifically hold the pin for one mS more before initializing the wizchip. I've used this boilerplate code for a half dozen devices (and my same schematic/pcb templates) without issue for many years now. \$\endgroup\$ Commented Feb 9, 2022 at 21:25
  • \$\begingroup\$ @ChrisKnudsen you do it right. WIZnet chips must be hardware reset after powering up, otherwise weird behavior may be observed. \$\endgroup\$ Commented Nov 1, 2022 at 20:32
0
\$\begingroup\$

A suboptimal layout will take more time than a good one once you take into account that you need to revisit it at some point. Once you get all the 'best practices' in your muscle memory, a good layout won't take more time to route. But I get it, I have done projects in small companies that where so time constrained, the PCB design had to be done within 1 day. Routing at '11 in the evening is just that much harder ;)

I have made a W5500 design that is tested working on STM32 and ESP. I have never experienced this reset issue/workaround. Heck, I didn't even have code running on the STM32 but the W5500 was being recognized by the network and link and act. leds working as expected. The only time this didn't work is when the firmware designer forgot to init the pins correctly and the W5500 was being kept in reset. That was an easy fix for a change.

I'm using a ferrite bead + capacitance filter for the AVDD, that has its own little plane next to and under the chip. The RX/TX pairs keep on top layer almost all the time, except for one unfortunate jump. The GND plane is extended to layer 3 for this section of the pair just to be sure. I'm using low capacitance TVS clamps on the data lines. This can be really important in certain environments. The routing becomes a bit less nice, but I'd say it's within limits. I'm using a oscillator instead of a crystal, but that shouldn't matter too much. The shield and internal magnetics ('wire' side) of the connector are AC grounded using a high-voltage MLCC. The routing is really compact, and manages to stay about as wide as the connector itself. This way you can kind of 'stack' them next to each other if your design ever needs another port. A double sided component layout would have made this layout even better and more compact, but that was going too far for this particular project.

The only main difference between our schematic I notice is you leave reserved pins open, I read in some reference example that you can pull them to ground to be sure. Also ofcourse the oscillator/crystal and TVS clamps. But that wouldn't matter too much unless your crystal is not starting properly, but I don't really suspect that. My Pmode pins are all pulled up, just as in your schematic

enter image description here

I hope this example is in any way useful to you

Just a thought: whenever the issue presents itself, measure the clock source and supply lines for any abnormal behavior. For different reasons people already stated your circuit could experience undefined/unexpected behavior

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.