Author Topic: Help choosing crystal for STM32G473  (Read 426 times)

0 Members and 1 Guest are viewing this topic.

Offline JaunedeauTopic starter

  • Regular Contributor
  • *
  • Posts: 111
Help choosing crystal for STM32G473
« on: December 23, 2025, 06:19:14 pm »
Hi,

  I am trying to design my own board with an stm2g473, and am lost when choosing the crystal. I need a 25MHz oscillator, and woulf prefer a rather small SMD quartz, apparently 3225 is rather standard and easy to find.

  I tried reading the AN2867 document from ST, and using their spreadsheet, but there is always some information missing (e.g. they say to look for "Cs"  "From the MCU datasheet  + Estimation of CPCB", but I don't know how to estimation what I think I Cpcb and could not find the info for the datasheet...

  Can someone help ?

Thanks, J.
 

Online peter-h

  • Super Contributor
  • ***
  • Posts: 5292
  • Country: gb
  • Doing electronics since the 1960s...
Re: Help choosing crystal for STM32G473
« Reply #1 on: December 23, 2025, 07:00:54 pm »
Crystals are a funny business.

The reality is that most of them work :) And if not needing accuracy, the capacitance is not that critical.

You quickly discover that the big brand xtals like Kyocera and AVX are pricey but well specced, and the no-name chinese ones are far cheaper but you may not get the same ones every time (because with most chinese stuff most people are reselling and nobody knows where some batch really came from). I have found to my irritation that a lot of the cheap xtals I had been using for years have been taken over by Abracon and the price went up 5x.

For example, for the 32F417 I use these branded xtals



but if you put those P/Ns into say mouser.com you find they are not exactly cheap and frankly I doubt many people use them in 1k+ volume. And in 100k+ volume the branded ones will be cheap :)

The cheapest one with the same spec as the CX3225 is the 815-ABM8G-25-18D2Y. If you are free to choose the package, Murata (a reputable make) do cheaper ones. But they only go up to 12pF. e.g. XRCGB25M000F1SBDR0

The xtals in the ST appnote are either expensive or obsolete.

You guess how many pF the PCB tracks will add. There is info online. 1-2pF usually.
« Last Edit: December 23, 2025, 07:42:49 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline JaunedeauTopic starter

  • Regular Contributor
  • *
  • Posts: 111
Re: Help choosing crystal for STM32G473
« Reply #2 on: December 23, 2025, 08:13:24 pm »
Ok, so I I try to put it all together, i can :
- Start with e.g. https://www.lcsc.com/product-detail/C2901687.html (because 1/ it's available in large quantities so probably easily avilable if I want someone to make another board 2/ it cna be ordered in minimum quantity of 5 so it ends up cheap and 3/ it is 20pF so maybe easyer to match than the 10pF ones ? Also the values in the datasheet seem to match what the STM spreadsheet expects)
- Take 25r as an estimation for ESR (datasheet says "25r between 20 and 54MHz")
- Take 3pF for C0 (datasheet says 3pF max)
- Take 13pF for CL (datasheet says min 6pF, max 20pF)
- Take 10pF for "Cs (total in pF) (estimation taken from stm32g473 datasheet)

The spreadsheet tells the gain margin is 39.58 (good enough), and `CL1=CL2=6", so I use 6pF capacitor and that should be work ? I test the frequency by having the MCU output the frequency and inspect it with and oscilloscope, and if it is too far from 25MHz I try other values for the capacitors ?
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4433
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Help choosing crystal for STM32G473
« Reply #3 on: December 23, 2025, 08:22:37 pm »
Unless you're especially concerned with frequency accuracy, that's not really the risk. Get the capacitance or layout wrong, and there's a chance that the oscillator won't start reliably under certain conditions of temperature, voltage, and sample-to-sample variation.

Personally I have better things to do than worry about this stuff, which is why 99% of the time I use oscillator modules rather than 'bare' crystals. They're small, robust and reliable, which is way more important in my case than a small cost saving.

Offline JaunedeauTopic starter

  • Regular Contributor
  • *
  • Posts: 111
Re: Help choosing crystal for STM32G473
« Reply #4 on: December 23, 2025, 08:46:59 pm »
Do you mean I can buy e.g. You mean I can buy e.g. https://www.lcsc.com/product-detail/C49207939.html (datasheet), connect it 3V3 and GND, connect pin 1 ("enable control") to 3V3 (I guess, datasheet is not very talkative) and send the signal on "OUT" directly to my MCU OSC_IN pin and configure it for external oscillator and everything works ? Do I still need to put some decoupling capacitors close to the oscillator ?
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4433
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Help choosing crystal for STM32G473
« Reply #5 on: December 23, 2025, 09:16:32 pm »
Yep, just connect to OSC_IN, put HSE in bypass mode and it should, as they say, "just work".

It's a good idea to put a decoupling cap across the supply for the crystal, just like you would any other active part. Also a 33R resistor in series between the oscillator output and the CPU will help with EMC.

Oscillator modules like this are available in a number of different sizes, some big enough to pick up with boxing gloves, others so tiny as to be unnecessarily fiddly. I tend to use 3.2 x 2.5mm if there's plenty of room on the board, or 2.5 x 2.0mm if it's a bit tight.

Also check out the MEMS oscillators from SiTime - they're drop-in replacements for standard quartz oscillators with about half the supply current.

Offline JaunedeauTopic starter

  • Regular Contributor
  • *
  • Posts: 111
Re: Help choosing crystal for STM32G473
« Reply #6 on: December 23, 2025, 09:47:28 pm »
Thank you, Ill do that on the first version of the PCB, and will test using internal oscillator (since I need to synch one another component's 3.59MHz clock anyway)
 

Online peter-h

  • Super Contributor
  • ***
  • Posts: 5292
  • Country: gb
  • Doing electronics since the 1960s...
Re: Help choosing crystal for STM32G473
« Reply #7 on: December 23, 2025, 10:04:48 pm »
Why is the Y322525MNCCZ about 1/10 of the price of brand name oscillators?

Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17067
  • Country: fr
Re: Help choosing crystal for STM32G473
« Reply #8 on: December 24, 2025, 01:02:55 am »
As peter said, I have yet to witness any case of a problem with those MCUs using pretty much any crystal with loading caps as spec'ed in the crystal datasheet.
Yes, you should take the parasitic capacitance into account (mainly PCB), but unless you have a very specific stackup or a very lousy layout, it will only add a couple pF which will usually be within the tolerance of the external capacitors themselves. In other words, it doesn't make a difference. The possible shift in actual frequency will usually be negligible relative to the rated initial accuracy of the crystal.

If you need very accurate oscillators, you will use a much more elaborate oscillator configuration anyway.

In practice, only in very specific cases, such as ultra-low power 32.768 kHz oscillators, can you run into real issues of unstable or not starting oscillators at all.

I would not recommend resorting to integrated external oscillators for a problem that doesn't exist in 99.9% of cases (unless you absolutely need accuracy with a TCXO or OCXO) and adds cost while cutting you off the possibility of using low-power features of the MCU (which disable the oscillator in Stop modes) other than "sleep".
 
The following users thanked this post: voltsandjolts, Jaunedeau

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2852
  • Country: au
Re: Help choosing crystal for STM32G473
« Reply #9 on: December 24, 2025, 06:03:07 am »
Ok, so I I try to put it all together, i can :
- Start with e.g. https://www.lcsc.com/product-detail/C2901687.html (because 1/ it's available in large quantities so probably easily avilable if ... I test the frequency by having the MCU output the frequency and inspect it with and oscilloscope, and if it is too far from 25MHz I try other values for the capacitors ?

If you have a freq ctr, or a GPS 1pps, you can test the exact crystal total operating C, - see curve below.
You've chosen a 10ppm model, which makes checking CL easier as you know the crystal operating point fairly precisely. 

The absolute value is not critical, they just move their calibration point along this curve.
Smaller CL crystals mean less gain degrade, so they are more preferred for higher Mhz.


 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2852
  • Country: au
Re: Help choosing crystal for STM32G473
« Reply #10 on: December 24, 2025, 06:08:13 am »
..The possible shift in actual frequency will usually be negligible relative to the rated initial accuracy of the crystal.

That was broadly true back in the days of 100ppm crystals, but these days 10ppm crystals are becoming standard. (The OP links a 10ppm model)
With those you can take the trouble to step the C's in 1 or 2pF increments to centre the crystal.
You can also use different C values, as the XIN pin has a higher pull-ability than XOUT.
 

Online peter-h

  • Super Contributor
  • ***
  • Posts: 5292
  • Country: gb
  • Doing electronics since the 1960s...
Re: Help choosing crystal for STM32G473
« Reply #11 on: December 24, 2025, 12:06:38 pm »
Quote
As peter said, I have yet to witness any case of a problem with those MCUs using pretty much any crystal with loading caps as spec'ed in the crystal datasheet.
Yes, you should take the parasitic capacitance into account (mainly PCB), but unless you have a very specific stackup or a very lousy layout, it will only add a couple pF which will usually be within the tolerance of the external capacitors themselves. In other words, it doesn't make a difference. The possible shift in actual frequency will usually be negligible relative to the rated initial accuracy of the crystal.

I think the 32768 "watch" xtals can be a bigger problem, because they have a crap Q factor (high ESR). I would be more concerned using el cheapo ones no-name ones (basically all the chinese ones) without doing some qualification process, over temperature, on say 5-10 units. That said, for many years I used to make a gadget which used one of these, around a CD40106, to drive a simple state machine, in a totally crude circuit, and 100% of them worked and none ever came back :) Should have used a ceramic resonator really...
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline uer166

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Help choosing crystal for STM32G473
« Reply #12 on: December 25, 2025, 02:58:07 am »
I do prefer 32.768 crystal oscillator modules where possible: they exist in pretty low power nowadays. Bonus points if your MCU can PLL the main clock off of it, then it's the only oscillator/clock source in system.
 

Online peter-h

  • Super Contributor
  • ***
  • Posts: 5292
  • Country: gb
  • Doing electronics since the 1960s...
Re: Help choosing crystal for STM32G473
« Reply #13 on: December 25, 2025, 03:12:43 pm »
That would preclude any kind of battery-backed RTC though. Even the xtal RTC is barely viable in most microcontrollers due to its ~1uA consumption being pretty high. And if you do not need a battery-backed RTC then you can implement an RTC with a timer interrupt only.
« Last Edit: December 25, 2025, 03:28:06 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf