2025-02-10 08:22 AM
Hello
Which are the correct Capacitors to use for HSE on STM32F103 with the following Crystal?
Frequency: 8 MHz
Load capacitance CL: 20 pF
Thank you in advance for a quick hint.
Regards
Michael
Solved! Go to Solution.
2025-02-12 05:57 AM
Hi,
so take 20pF (or 16...22pF) - and it will work.
standard circuit:
In cpu F103 is everything, just connect the crystal + 2x 22pF .
2025-02-12 06:08 AM
I have just taken the parameters of your crystal and calculated them according to the AN2867: with a gain margin of 58.451 you are considerably above the minimum of 5, so you can continue working with this crystal.
If you assume a pin capacitance of 4pF, your load capacitors should therefore be larger than 20pF and be around 32pF (2x32pF in parallel + 4pF pin capacitance = 20pF).
However, the layout is just as important as the capacitors, as I mentioned in a previous post.
Good luck!
/Peter
2025-02-12 06:35 AM - edited 2025-02-12 06:49 AM
Let's do a calculation based on what AN2867 says.
The rule is to have gain margin > 5 (a condition that lets the oscillation to start).
Where:
gm is given by product in the table 6 in the application note:
gm crit formula is provided in the 3.4 Oscillator transconductance section:
In your case:
CL= 20 pF, C0 = 3 pF, ESR = 80Ω
-> gmcrit = 4 x 80 x ( 2 x pi x 8.10 6)² x (3.10-12 + 20.10-12)² = 0,42 mA/V
An example of calculation has been provided in the same application note:
So in your case gain margin = 25 / 0,42 = 59 > 5
Normally it should work.
Hope that answers your question.
2025-02-12 07:09 AM
I have to choose 30pF or 33pF.
I will select 33pF then for the 2 C, as it is more near your value.
Thank you very much!
About the layout: It sure not will be ideally, as my PCB will be 2 layers only.
I for sure try to put the crystal and the 2 Capacitors as close as possible to the OSC pins.
@SofLit thanks for confirming that my crystal should work.
2025-02-12 07:11 AM
As your question has been answered please Accept as solution the comment that answered your question (Not this comment).
Thanks.