Skip to main content
Visitor II
August 14, 2020
Question

HSE Crystal - choosing the right capacitor

  • August 14, 2020
  • 1 reply
  • 2467 views

Hi :)

I am doing a project where I need a (relatively) accurate crystal. I have never used special precision crystals but my guess is a normal crystal would do. I would like though to have the best accuracy possible by laying out the PCB and choosing the capacitors accordingly.

The project uses an STM8L151G6U6, and the datasheet shows an input capacitance of 2.6pF.

0693W000003PNknQAG.png

My crystal has a load capacitance of 9pF.

My crystal traces are 10mil thick and about 300mil each - see the picture below. If I assume a stray+pin capacitance of 5pF total, that means I should choose (2*9) - 5 = 13pF, so I would choose a 12pF cap.

0693W000003PNtQQAW.png

My questions:

1) Is this all wrong and the capacitance has nothing to do with precision? (I am sure I read that somewhere but I cannot find it anymore :\ )

2) Is my way of calculating correct?

3) Is there a way to guestimate a bit better the stray capacitance based on the length and thickness of the traces?

4) In the picture you can see I route the pin to the crystal, and then the crystal to the cap. Would it be better the other way around (first pin -> cap, then cap > crystal)?

Thank you!

Simon

    This topic has been closed for replies.

    1 reply

    Visitor II
    August 16, 2020

    Take a look at AN2867. It has good stuff in it. Now, you can take the easy way and just do what everybody does and experience shows good results, or you can dig in it to optimize your oscillator circuit.

    https://www.st.com/resource/en/application_note/cd00221665-oscillator-design-guide-for-stm8af-al-s-stm32-mcus-and-mpus-stmicroelectronics.pdf

    SLasn.1Author
    Visitor II
    August 16, 2020

    Amazing!! Thank you - I'll look into right now ;)

    SLasn.1Author
    Visitor II
    August 16, 2020

    I saw that in the datasheet but I was not sure - now I read it again in the AN2867: the feedback resistor (R5 in my case) in not needed with STM8/32 MCUs.