cancel
Showing results for 
Search instead for 
Did you mean: 

How to choose crystal speed?

b.a.
Associate III

I just was wondering how you guys proceed to choose an external crystal, specifically what speed it should have...

The clock management with its tons of PLLs and dividers seems to be able to scale up almost any source to a desired frequency.

for the L4+ range that operate at 120MHz, it looks like that can be achieved from a 4MHz as easy as from a 48MHz crystal.

So what are the benefits and caveats of using a faster/slower crystal?

Or just stick with the 8MHZ of the Nucleo boards, which I think can be considered somewhat as a reference design?

16 REPLIES 16
Peter BENSCH
ST Employee

You will find answers if you read the AN2867 carefully and try to ensure the stability of the oscillator with common high-frequency crystals and the required capacitors (including board parasitics) and over the whole temperature range.

It is simply cheaper and easier to realise if you use low-frequency crystals such as 4...8MHz for HSE.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AScha.3
Chief II

my 2 cts : dont use a crystal, take crystal oscillator, frequ. medium, as reference boards use, maybe 8 or 12 or 25 MHz, and select the cheapest, thats available from different sources.

and set "bypass" in Cube for oszillator .

and put 80 or 100 ohm in clock connection, to avoid reflections and new trouble. (my way...)

If you feel a post has answered your question, please click "Accept as Solution".
Piranha
Chief II

The first question is whether the device needs HSE at all. Many devices can run from HSI/MSI just fine.

And if you have a strong need for a specific frequency TCXO. For example the use case calls for 10, 19.2, 26, 30.72 or 44 MHz. Radio being an application where tight on frequency and stable has significant benefits.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks Peter,

I had found that document already and am eagerly reading :)

b.a.
Associate III

It sure will run, but if you want somewhat decent timing accuracy, it's sure not the way to go.

The specs are quite poor compared to a standard crystal setup...

Piranha
Chief II

The question is whether the specific device needs that accuracy. For example, SPI, I2C and other synchronous interfaces doesn't need crystal level accuracy. Ethernet needs +/-50 ppm, which obviously needs a crystal. USB needs +/-0,25 %, but your MCU can do it with MSI synced with LSE or HSI48 with clock recovery based on USB SOF sequences.

S.Ma
Principal

Usb host would command external precise hse, then for usb device, msi would relax the constrains. Ethernet would probably require 25mhz which could be buffered by external transceiver fed to the mcu. For the hse value, clive gave some clues. Msi has some sweet frequencies. Otherwise, check flash wait states vs mhz and if low power is a concern on non msi mcu, running with pll bypass at high frequency enables instant prescaling gearing down and up.

gregstm
Senior III

If possible, I use no crystal. If I need a crystal for accurate audio generation/analysis, I just use the 32KHz crystal (which can be used to trigger DMA etc. up to 64KHz), as long as the 32KHz is providing an accurate drum beat, I don't care if the main processor is running at an imprecise frequency. I only resort to a higher frequency crystal when MHz clock frequency accuracy is required eg. generating a video signal.