Electronics > Microcontrollers

CPU crystal "pull" range and how critical are the caps, for e.g. USB FS

(1/7) > >>

peter-h:
I have a 32F417 design, and after a couple of years of building little batches, qualifying various components (e.g. RJ45 integrated jacks from Hanrun and fake-Hanrun, various xtals, etc) while developing the software, I am now building an initial "pre production" batch of 100.

Over the years I've evaluated various crystals. There are two: 25MHz and 32768Hz - as usual. The 25MHz one is scaled up to 50MHz for ETH and to 48MHz for USB FS.

The problem is that these crystals are hard to buy the same one twice :) For example CX3225GB25000P0HPQCC comes in about a dozen endings after the 25000. Some of these are documented in the data sheet but not all. For example this one
https://www.mouser.co.uk/ProductDetail/KYOCERA-AVX/CX3225GB25000P0HPQZ1?qs=WtbxmXO%2FfWTKVKFSKFjSnA%3D%3D
is no longer available, but this one is
https://www.mouser.co.uk/ProductDetail/581-CX3225GB25PHPQCC
There are also mistakes in the disti's spec summary, and they vary between Mouser and Digikey.
This one is in stock at Mouser
https://www.mouser.co.uk/c/?q=FA-238%2025.0000MB-G0
but I am unable to find the spec for it anywhere; certainly the data sheet doesn't appear to mention the "G0".

Some are "18pF" and some are "20pF" which seems ridiculously close.

For many years I used AEL Crystals, which basically sell no-name chinese crystals which are about 1/4 the cost of the Kyocera or Epson ones above, but now AEL want a £1000 min order value, which I can do but don't want to do it right now. Luckily I did qualify crystals from them in years past, before they did this MOQ thing. I don't know who actually pays 45p for a crystal in production??? Two other outfits, IQD and Euroquartz, only do pricey stuff now.

So we get to the crux of the question. One is working only with guesses for the CPU pin capacitance and the PCB track capacitance. Some estimates for these are 5pF and some are 10pF, per pin. I think 5pF is probably nearer, with a compact oscillator layout, with a ground plane under it all. I have read up it for hours and all I see is websites showing a ton of oscillator formulae and nothing actually useful. How much is the oscillator frequency going to be pulled out if you get the capacitance seen by the xtal off by say 5 or 10pF? I have a feeling it will be only a few ppm and nowhere near enough to affect ETH or USB FS.

I have never actually measured the frequency; I don't have a frequency counter and anyway it would need to be a good one, and sensitive so no connection is needed. I have a Marconi 2024 sig gen and an Anritsu spectrum analyser which could work off a no-contact probe, but the oscillators in these are no better than 10-20ppm anyway.

I've also seen ETH and USB FS designs work with crystal resonators - about 0.5% i.e. 5000ppm. And this is not the USB which syncs off the Host, either...

For final amusement, the STM eval board uses a 1M resistor across the xtal, which is normal except that you don't need it because the 32F417 has an internal 200k one. Whoops :) I don't use a resistor...

It is pretty obvious that this whole business works on the blind leading the blind and the answer probably is "it doesn't matter" :)

T3sl4co1l:
The ST appnote is one of the more convincing / well written ones:
https://www.st.com/resource/en/application_note/an2867-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf
maybe ironically -- but perhaps because of -- their somewhat notoriously? weak oscillators.  That is, they tend to use lower drive current, or less transconductance, than most, necessitating a higher ESR (lower CL) crystal than average.

There indeed exists a methodical design and testing procedure for crystal oscillators.  The main problem is, whether required supporting information is available (e.g. gm of oscillator, at frequency, and at drive strength/mode(s); Cstray, Rfb, etc.), and whether min/max/median parts are available to actually test, plus env chamber to run at temp extremes, and supply voltage extremes; and, most of all, whether the budget and time is there to actually perform such testing, versus whether it's worthwhile at all.

Conversely, you can buy and measure random crystals: Fo, Cs, CL, ESR, ppm/°C, pulling, etc.  But this is a bit of work, and moderately specialized hardware is required (I suppose 32kHz crystals you could do with a sound card, but mostly you'd want a VNA, of adequate spectral purity to resolve such narrow resonance), and if you're actually going to sort random parts, there's maybe no guarantee they'll be supplied consistently either, and now you've developed a receiving parts test program at whatever expense it is.

And as you can see, it can take specialized hardware.  An AC current probe to resolve µA into a crystal, is not exactly trivial.  Most people don't have one of those handy, and it's going to be special order.  A regular 10x voltage probe is insufficient as well: Cload is significant even for MHz crystals, and both Rload and Cload is too much for most watch crystals (100s kohms).  A FET probe is probably best; easy to make, at least, but also easy to fry, and if one doesn't want to make it, it's still another instrument to buy.

The principle of least surprise tends to apply, then, with no one bothering to test, and assuming the most common parts and most commonly repeated circuits are valid.  And they do usually work, but no one knows what the production yield is, whether they conk out at low or high temperature, whether complaints / service calls / warranties can be traced to it or not, ..., and yes, it can be "blind leading the blind".  Or perhaps, "blissful led by the ignorant", to merge with another phrase.

Regarding USB and Ethernet, at least, they're quite tolerant as far as I know -- but also, you'd have to know what the interfaces actually do, to know what clock tolerance is really acceptable; to know how they degrade if at all along the margins of that range; those sorts of things.

---

As for pulling -- note the C-crystal-C 'pi' structure acts to invert the parallel resonance to a series one, roughly speaking; C is inversely proportional to Zo of the filter.  So you have an impedance there, and that impedance must be near the oscillator's required load impedance (or 1/gm or whatever, plus margin to ensure oscillation of course).  You can vary Cload to vary Fo, but you vary Zo as well.  You can also put C in series with the crystal, which reduces the crystal's effect (in the limiting case, there's lim-->0 capacitance in series, and all C in shunt -- no crystal in circuit at all!), i.e. the depth of the resonance, but keeps the impedance close to nominal while allowing you to reduce Cload.  In total, you have strategies to pull it a little bit, up or down -- as for depth of pulling, it's usually some 100s Hz, maybe a couple kHz at most -- and if you have poor initial tolerance but acceptable stability, this might be a strategy to make use of it, assuming of course the resulting range is outside what's required for the hardware driven by it.  But then you're also adding a calibration (trimming) step, maybe with a special probe to read the crystal (if a direct logic-level clock isn't available; usually Ethernet does have this, USB doesn't?), and the added test time starts to look like qualification testing, and...

As for that last part, hardware tolerance?  If it's not in the datasheet -- or it is, but you want to know more -- you'll have to ask the manufacturer, of course. :)

Tim

SiliconWizard:
USB FS is rather tolerant, which is why it can be handled on some MCUs with their internal RC oscillator and about +/-1% frequency accuracy. (Even higher error is probably still ok.)
So a small change in the value of the load capacitors on a crystal will not make any difference. You probably have already figured that given the typical tolerance on usual ceramic caps, 2pF over 18pF is about 10%. Which is the typical tolerance for cheap ceramic caps, even C0G. For better than +/-10%, they get more expensive very quickly. (Like at least 10x the price to get from +/-10% to +/-1%.) I don't think anyone ever bothered to use +/-1% C0G load caps for the crystal oscillators for MCUs outside of maybe very niche applications.

I'll have a look at the USB specs in more details to give you the exact tolerance that is specified for USB FS. But the above points should give you a clue about the relevance of bothering with the exact value of load caps.

PCB.Wiz:

--- Quote from: peter-h on February 20, 2024, 06:02:41 pm --- Some estimates for these are 5pF and some are 10pF, per pin. I think 5pF is probably nearer, with a compact oscillator layout, with a ground plane under it all. I have read up it for hours and all I see is websites showing a ton of oscillator formulae and nothing actually useful. How much is the oscillator frequency going to be pulled out if you get the capacitance seen by the xtal off by say 5 or 10pF? I have a feeling it will be only a few ppm and nowhere near enough to affect ETH or USB FS.

--- End quote ---

FS-USB has tolerance of ±0.25% or 2,500ppm so xtals can easily meet that, even with 'lazy' load cap choices.
HS-USB has tolerance of ± 500ppm, so HS-USB designs should check to confirm their crystal is correctly loaded.


It's easy to find pulling data - see
https://ecsxtal.com/choosing-series-or-parallel-resonant-crystals-oscillator-design-and-load-capacitance/

that has a graph, which shows 10/20/40ppm/pF ballparks, increasing as the crystal load decreases. Roughly it is 2ppm/% Cap change. 10% C change is ~20ppm
Note that is nominal, the actual circuit ppm/pF varies with XTALI/XTALO pin, with XTALI having higher pulling than XTALO.


--- Quote from: peter-h on February 20, 2024, 06:02:41 pm ---Some are "18pF" and some are "20pF" which seems ridiculously close.

--- End quote ---
yes, for most uses it will not matter.
However, if you buy an initial 10ppm spec xtal (which are becoming more common) that 10% change is a 20ppm movement.
The tricky part is knowing where inside that 10% your test crystal is, so you might measure a dozen boards and calibrate to that average, if you want good initial tolerance.



--- Quote from: peter-h on February 20, 2024, 06:02:41 pm ---I have never actually measured the frequency; I don't have a frequency counter and anyway it would need to be a good one, and sensitive so no connection is needed. I have a Marconi 2024 sig gen and an Anritsu spectrum analyser which could work off a no-contact probe, but the oscillators in these are no better than 10-20ppm anyway.

--- End quote ---
It's a good idea to be able to check frequency, but you need to avoid loading the crystal when doing so, so usually some pin is set to toggle by a timer, and that is checked.

PCB.Wiz:

--- Quote from: peter-h on February 20, 2024, 06:02:41 pm ---is no longer available, but this one is
https://www.mouser.co.uk/ProductDetail/581-CX3225GB25PHPQCC

--- End quote ---

Looking at that it says

Description: Crystals 25000kHz 18pF With Thermistor

Do you really want one with a thermistor ? 
Usually those are used where you are making your own TCXO, and you need the xtal temp to correct things, and worry about single digit ppm ?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod