Which frequency crystal/oscillator for a STM32F microcontroller - Page 1
Forum section: electronics / general

author: Kjelt
author_rank: Super Contributor
timestamp: August 26, 2014, 07:36:54 am
content: Hi I was just wondering since in the evaluation boards of ST I see a lot of different frequency oscillators, like on the F10x devices typ. 8MHz,on the F2xx devices typ. 16 or even 25MHz.Now looking in the ref manuals the F1xx HSE osc. input can have any frequency between 4-16MHz and the F2xx any frequency between 4-26MHz.Since with the pll and clockdevider registers you can almost choose any clock frequency from either oscillators, is there any particular other reason you choose a certain frequency for the oscillator?

author: pyrohaz
author_rank: Regular Contributor
timestamp: August 26, 2014, 07:40:16 am
content: Whenever I make my own boards, I just use a standard 8MHz crystal oscillator as these are easy to get a hold of and work with 18pF capacitors (for my PCB's anyway). The STM32F0 discovery board doesn't even have an on board crystal (for the actual microcontroller that you program) as this processor can either use the HSI clock or use the external clock derived from the STLink microcontroller.

author: dannyf
author_rank: Super Contributor
timestamp: August 26, 2014, 10:30:46 am
content: Not specific to STM32F chips but generally the datasheet specififies the valid frequency range - your crystal would have to fit into that range.From there, I usually pick the lowest frequency that with the PLL can hit the highest operating frequency. Say your chip can run at 72Mhz max. With a PLL multiplier from 2x - 16x. I would pick 8Mhz crystal (8Mhz x 9 = 72Mhz). This approach allows the widest range of possible frequencies.After that, you may need to refine it, for example if you are running a uart; or if you require a particular master clock out frequency, etc. Or due to sourcing: 4/8/16/24Mhz crystals are the most common ones. Or if you are running USB.

author: Kjelt
author_rank: Super Contributor
timestamp: August 26, 2014, 12:26:38 pm
content: So there are no EMC or other consequences why you should pick the lowest or highest frequency for the crystal/oscillator?

author: dannyf
author_rank: Super Contributor
timestamp: August 26, 2014, 12:53:39 pm
content: It can be part of the "refine" process. But it has rarely made it to my priority list - I have used clocks in the 200-400Mhz range without problems.

author: andyturk
author_rank: Frequent Contributor
timestamp: August 27, 2014, 12:18:32 am
content: Quote from: Kjelt on August 26, 2014, 12:26:38 pm8MHz is fine for most things. 16MHz crystals are often smaller in size, if that's interesting. When you're going to use USB, make sure you can generate a 48MHz clock via the PLL. They're pretty flexible, so it won't be a problem with any frequency that's a multiple of 8 (or 12) MHz. Also, make sure your crystal's load capacitance is consistent with what the mcu can handle.

author: David Hess
author_rank: Super Contributor
timestamp: August 27, 2014, 04:26:37 pm
content: In some applications you may not want to use the internal PLL because of startup time, power draw, or excessive phase noise. Another reason to select a specific external crystal is if the external clock frequency will be used to drive other circuits.