A Matlab Script to Calculate Xtal Gm

Make it to the Right and Larger Audience

Blog

A Matlab Script to Calculate Xtal Gm

Here is a good xtal analysis paper from Cypress.

Based on this paper, there is a short matlab script to calculate xtal gm.

Equivalent circuit is as above. Crystal parameter is assumed/given in script using 32.768Khz crystal as an example:

External driving circuit needs to be given by user. Here are some example numbers to use:

Parasitic Capacitance Cp (pF) :2
Input Load Capacitance C1 (pF) :15
Output Load Capacitance C2 (pF) :20
Input Load Resistance R1 (MOhm) :100
Output Load Resistance R2 (MOhm) :30
Feedback Resistance R3 (MOhm) :10
Output Protect Resistance Re (kOhm) :100

Script then calculates transfer function, find root locus, etc. The main calculation is as below:

Results are displayed as:

—————————  Crystal Parameter  —————————
Quality Factor : 50.0000 k
Nominal Frequency : 32.7680 kHz
Series Frequency : 32.7644 kHz
Relative Frequency Pull : 111.1111 ppm
Motional Resistance : 32.3838 kOhm
Motional Inductance : 7.8653 kH
Motional Capacitance : 3.0000 fF
Shunt Capacitance : 1.5000 pF
Nominal Frequency : 32.3838 kHz
——————————  Circuit Parameter  ——————————
Actual Input Load Capacitance C1 = C1 + Cp : 17.0000 pF
Actual Output Load Capacitance C2 = C2 + Cp : 22.0000 pF
Actual Shunt Capacitance C3 = Cs + Cp : 3.5000 pF
Input Load Resistance R1 : 100.0000 MOhm
Output Load Resistance R2 : 30.0000 MOhm
Feedback Resistance R3 : 10.0000 MOhm
Output Protect Resistance Re : 100.0000 kOhm

============  Calculation Display  ===================
Critical Transconductor gmcrt : 1.4155 uS
Critical Freq. is : 32.76817 kHz
Damping is : 0.00
Opitmum Transconductor gmcrt : 25.4742 uS
Opitmum Freq. is : 32.77320 kHz
Damping is : 26.47
Maximum Transconductor gmcrt : 135.1761 uS
Maximum Freq. is : 32.77823 kHz
Damping is : -0.00

The script is here: .cal_gm.zip

Engineer
Author brief is empty
Groups:

Tags: