WIZnet Developer Forum

Debugging the 25MHz crystal oscillator

I’ve been having trouble getting my ATmega32U4 + Wiznet W5500 to work and I think I’ve traced the problem down to the crystal oscillator loop.

The problem is that there is no network activity. The LEDs on the RJ45 ethernet jack don’t light up at any time, and none of the LED signals from the W5500 light up initially on reset either. Bizarrely, I find that if I touch the XI track with a 10Mohm oscilloscope probe, the SPDLED lights up, but nothing else happens. This made me suspect the crystal is having trouble oscillating at 25MHz, so I tested XI and XO with the scope:

On XI, I see a nice 25MHz waveform:


The divisions are 20ns, and the wave takes up two divisions per period so 40ns, or 25MHz. The amplitude is 2Vpp (3.3V supply) which seems reasonable.

On XO, though, I get a messy waveform:


The waveform is obviously not sinusoidal and its peak-peak amplitude is that of the supply rails. In both cases, I measure the XI/XO track with respect to ground. It seems like the crystal, capacitors and resistors are not working correctly.

I suspected it was the load capacitors. The crystal I use (FA238) requires load capacitors of ~12pF, so I used two 18pF capacitors in parallel. When this didn’t work I tried lots of other combinations, like 30pF, 18pF, 12pF, 10pF, 6pF, and none of them worked.

Now, since XI is the crystal waveform input for the W5500, and it looks ok on the scope, it could be that this isn’t actually a problem, and the problem is somewhere else, but I thought I’d check with you guys. So, is it normal for the XO waveform to be so screwed up, even though the XI waveform is ok? Does anyone have a suggestion for different components to check/replace?

One other curiosity that might be relevant: on the Arduino boards, they use a similar SMD crystal package to the one I used (but at 16MHz). On the Ethernet shield, however, they use a big SMX package like this. I wonder if they also had trouble with small 25MHz oscillator packages?

The OSC circuit is really very sensitive, e.g. it may stop working if you touch it with wet finger. I did some experiments with W5100, and it seems when oscillation stops, chip is just being “suspended”. In your case when you touch the circuit, it may just suspend itself.

I used HC49S package to Arduino’s device; and I recall someone was having issues with more advanced packages like yours. Thus if you can, try putting HC-49 crystal and see how it works. It may also help if you share your circuit diagram and board image with area of W5500.

Hi Eugeny,

Here’s a picture of the board near the clock and W5500.


The C25 capacitor fell off earlier, but obviously during tests it was present: I guess the crystal is not as close to the W5500 as it could be, and the XI and XO track lengths are different, but I’d be surprised if that’s what’s causing this.

You might remember this thread - that was the previous design. I suspected the RJ45 transformer was to blame so I made a new version with a different (recommended) part - but I got the same issue which is why I now suspect the clock.

The schematic is the same as shown in post 2 in that thread, except the transformer is now a Cetus J1B1211CCD (also recommended by Wiznet) with appropriately updated routing (it has separate central taps for RX and TX).

Cheers!

While board design can be made better, IMHO it is NOT so bad that it does not work the way you describe. I can not check my board right now, but have feeling that your clock measurements must show normal operation.

Said that, I would do the following:

  • carefully check soldering. Seems board was hand-soldered, clean the chip and space near it to ensure you do not see any shortages between pins, and all pins are soldered decently (use needle carefully inserting it between two adjacent pins to see if any of these pins start to move);
  • anyway try another crystal, the type you can find on the Eth Shield device;
  • can you check if W5500 is available through SPI? Is it available from its digital side?

Thanks, I’ll try to find another crystal package that has the required frequency and see if it changes anything.

Do you have any specific feedback on my board layout? If a different packaged crystal fixes the problems I’ve had then I’ll have to make another board, so I can incorporate changes.

Here’s how I did it

wiznet-crystal-connection

Also ensure there’re no tracks at another side of the board (GND plane, crystal is inserted from another side) so that no signals interfere with the circuit.

Thanks, using a bigger package like the one you posted worked to fix the stability issue.

1 Like

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.