2023-08-30 04:56 AM
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:
Not so important Question:
Thank you for your insights and guidance.
2023-08-30 01:16 PM
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:
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
/Peter