HSE Crystal - choosing the right capacitor
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.

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.

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
