1
\$\begingroup\$

I've googled around and also found ST's AN2867 on oscillator design, but I don't find one key info: How high are the clock precision requirements for an STM32, driving a 100BASE-T ethernet PHY over RMII? Other threads say that Ethernet and USB have "elevated" requirements, but how high exactly?

Edit: This TI Documents says: "To comply with the IEEE 802.3 standard, each Ethernet node must have a reference clock with accuracy of ±100 parts per million (ppm)."

The next question would be: If I feed the STM32 with a 10 MHz clock, with 1 ppm precision and the clock is multiplied internally, to 50 MHz, does the ppm value propagate to a clock output, or change? For example, the datasheet of the TI DP83826 ethernet PHY specify the 25, or 50 MHz clock input at 100 ppm max. Does that mean I should provide the STM32 with a clock of better than 100 ppm precision?

Another question: The internal PLL and clock configuration options in STM32 devices can derive the system clock from a wide range of input frequencies. How do I choose a crystal if any in the range of 1 - 16 MHz can be multiplied to the desired clock? Is lower better? Is it better to get as close to the target clock?

To clarify: I don't care if it's a pure crystal, or a TCXO as long as it meets the requirements.

edit 2024-05-14 Dave Jones actually just made an interesting video on crystal oscillators

\$\endgroup\$
2
  • 1
    \$\begingroup\$ It seems the question uses confusing terminology, are you asking about a "crystal", a piece of quartz that connects to MCU oscillator, or about a "crystal oscillator", a self contained module which contains both a crystal and oscillating circuitry which you feed power and get square wave clock out? \$\endgroup\$
    – Justme
    Commented May 2 at 18:51
  • \$\begingroup\$ I know of the different options, pure crystals and TCXO's for example. Basically I'll take either of which, as long as it meets the requirements. I'm sorry for not clarifying in the question. \$\endgroup\$
    – adrifromhh
    Commented May 2 at 19:17

2 Answers 2

2
\$\begingroup\$

ppm is a ratio. If the input is within 100ppm then the output will be within 100ppm of nominal PLL output ratio. Similarly if it was a divider producing a lower frequency.

There may be more or less jitter, but that's not what you asked about.

If it's not possible to generate an exact multiplication ratio then you will need to account for that as well, but 5:1 is an integer and should be possible.

There are various small advantages and disadvantages to different crystal frequencies, with 4-32 MHz generally being the most attractive. Physically smaller crystals are more common in high frequencies.

Physically larger crystals tend to be easier to get appropriate drive levels (eg. just picking a random HC49-S package, drive level is specified as 1-500uW with 100uW recommended, and a random metric 3225 crystal specifies 10-200uW max with 100uW recommended).

The lowest hassle, if power consumption is not important and small differences in cost are not a major consideration, is to use a packaged oscillator from a reputable manufacturer since you won't have to worry about matching the crystal load capacitance for accurate output frequency, ensuring the drive power is not too high, and ensuring start-up is reliable under all conditions.

If you get the load capacitance (including stray capacitance) of the circuit surrounding your crystal wrong the oscillator may not meet your accuracy requirements, even if the crystal itself does meet specs. You can estimate the 'pullability' of a crystal (the change with load capacitance) if the manufacturer provides the motional and shunt capacitance parameters (few do).

\$\endgroup\$
0
1
\$\begingroup\$

The answer really depends on which STM32 you will use.

Technically, if precise enough clock frequency goes into STM32, the PLL just multiplies the frequency, and then precise enough clock frequency comes out. Have precise 1 ppm 10 MHz going in, multiply with exactly by 5, and precise 1ppm 50 MHz comes out.

However, there is always a but. One STM32 intended to be used with Ethernet, was initially suggested to be able to use the PLL output for clocking the PHY like in the evaluation board. But then application notes and erratas stated it should not be used for that due to PLL output jitter, which means that while the frequency is precise enough, there is just too much variation between output clock edges.

So the point is, if you try to clock the PHY from 50 MHz reference clock generated by MCU PLL, it might be wrong approach due to jitter. Double check if your specific MCU has a PLL with specs that allow it. If not, you need to clock the PHY with 50 MHz separately, and the MCU can run with cheaper crystal.

\$\endgroup\$
5
  • \$\begingroup\$ Thanks for the reply. To your second statement: That's what I ment, so the clock precision can be degraded to a degree, due to jitter and imperfections in the PLL circuit. Anyway, I think i will put a good amount of headroom on the 100ppm requirements and still find a cheap TCXO, or ST-recommended crystal. \$\endgroup\$
    – adrifromhh
    Commented May 3 at 10:02
  • \$\begingroup\$ @adrifromhh That might not help. The problem is not the precision, it is the jitter. Which can be easily solved by not clocing the PHY from STM32 PLL to begin with. PHYs generally run with their own crystal, or, crystal oscillator. The STM32 does not need the precision, the PHY does. \$\endgroup\$
    – Justme
    Commented May 3 at 10:13
  • \$\begingroup\$ Oh, thanks for the suggestion! I'm completely new to Ethernet hardware, so my understanding was that the PHY is supposed to be clocked from the micro with RMII, whereas with MII, the clock comes from the PHY. I was also looking at the wESP32 project, where the RMII clock also comes from the ESP32. \$\endgroup\$
    – adrifromhh
    Commented May 3 at 10:23
  • \$\begingroup\$ @adrifromhh Like I said, it might be possible that your MCU can output 50 MHz reference clock for RMII, but even if it can, it may be unusable due to jitter. You never even said which exact MCU you have. But you need to look the ways it can or must be done with your exact MCU and PHY. Some PHYs have PLLs and can output the RMII reference. Some combos need a 50 MHz oscillator. Sometimes you can use STM32 PLL to generate it. It depends on the details. What you asked just wasn't really what you wanted to know, classical X-Y problem here. \$\endgroup\$
    – Justme
    Commented May 3 at 10:36
  • \$\begingroup\$ Yes, I was intentionially not stating a particular STM32 model yet, because that's another thing I'm still evaluating. I'm in the process of putting all the pieces together. This was much help already, thanks! \$\endgroup\$
    – adrifromhh
    Commented May 3 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.