A tool that assists board design engineers in selecting appropriate load capacitors for MHz or kHz pierce oscillator circuits.
This tool helps ensure that the gain margin (safety factor) and frequency tolerance of a crystal are within project constraints. It performs the necessary calculations based on crystal parameters from the datasheet and the measured frequency from the board.
- Python with Jupyter Notebook
- NumPy
- Matplotlib
# Install dependencies from requirements.txt
pip install -r requirements.txtRun the notebook:
jupyter notebook cl-vs-freq.ipynbEnter your crystal parameters in the notebook:
fs: Series resonant frequencycm: Motional capacitancec0: Shunt capacitancecl_nominal: Nominal load capacitance from datasheetc1c2: Current capacitors on customer schematicf_customer_board: Measured frequency on-board
The notebook will output:
- Recommended C1=C2 capacitor values
- Board stray capacitance estimate
- Trim sensitivity, anti-resonant frequency, and motional parameters
- Visual plots showing CL vs frequency relationships
- Text file (
output.txt) with all calculated parameters
GPL License - See LICENSE for details
Ryan Thompson - @rthomp10
Project Link: https://github.com/rthomp10/load-capacitor-assistant
