Showing results for 
Search instead for 
Did you mean: 

Selecting the Correct Capacitor and Resistor Values for an HSE Crystal on an STM32F446RETx


I am currently working on a PCB that involves an STM32F446RETx microcontroller. I've encountered some difficulties in selecting a suitable 16MHz HSE crystal oscillator.

Since my intention is to order the board from JLCPCB and avoid any manual soldering, I've opted for the Crystal X322516MLB4SI. To make this choice, I referred to the STMicroelectronics Datasheet, specifically "AN2586," which provides guidance on designing with an HSE crystal.

My design approach is as follows:


Following the recommendations in the "AN2867" HSE Design Guidelines,


I've selected C_L1 and C_L2 values of 20pF. Subsequently, I calculated an R_ext value of 497 Ohms. To match this value with a standard resistor from the E-Series, I've decided to use a 510 Ohms resistor.


Now, I have a couple of questions:

  1. Is the calculated R2 value accurate?
  2. Is this design suitable for the HSE Crystal Y1 (X322516MLB4SI)?

Not so important Question:

  1. In the pictures below they show that the R_ext Resistor Value is 0 (for the STM32F4) and 390 (for the STM32F103), does that mean, that between STM32s there are different values used?YEQuit_6-1693396483392.png

    Thank you for your insights and guidance.



ST Employee

Actually, the AN2867 is very detailed regarding the crystal circuitry and especially also the layout for the oscillators HSE and LSE. Apart from the ESR, the data sheet of your X322516MLB4SI unfortunately does not show how the order designation is broken down, so I used the parameters of the distributors (ESR=80ohms, C0=7pF, CL=9pF) for the calculation. This gives gm(crit) as 0.828mA/V. According to AN2867, table 6, the value of 5mA/V applies to the HSE of the family of STM32F4 for gm(min). From both, the gain margin is 6.039, which is sufficiently larger than the recommended stability criterion of 5.

A series resistor to the crystal, R2 in your case, would lower the gain margin significantly: with 510ohms to 0.819 (much smaller than 5), which would make the HSE unstable. With 15ohms you would reach 5.086, which would be just acceptable. In general, however, there is no need for a series resistor to the crystal.

Much more important is the correct layout, for which very important hints are given in AN2867, section 7. Specifically, for maximum stability under all possible environmental conditions, it is necessary to:

  • provide a separate GND area for each crystal (red in fig. 14) one layer below the crystal (i.e. not the layer on which the crystal sits, but one layer below)
  • connect this separate GND area of the crystals separately from the other GND plane to the GND pin of the STM32 closest to the OSC pins
  • in the layer on which the crystal sits, place a guard ring around the crystal, which is connected to the separate GND area with several vias (also shown in fig 14).

This results in a GND structure around the crystal that looks like a hand in which the crystal lies, so to speak, with the "arm" representing the GND connection that must be connected separately to the GND pin.

Regarding to your not so important question:

The STM32 families not only have oscillators with differing parameters, but also the parameters of the crystals used and their frequency play a major role in stable operation under all conditions. Unfortunately, the AN2867 is too rarely given the necessary attention, although a stable oscillator is a fundamental and absolutely necessary prerequisite for stable work of every microcontroller.

Hope that helps?

Good luck

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.