mirror of
https://github.com/diodeinc/pcb.git
synced 2026-09-14 20:17:19 +08:00
4413c9d4d9
* Hydrate V2 deps during migrate * Fix mixed hydrated package resolution * Simplify workspace discovery * Clean up workspace package discovery naming * Update stdlib formatting paths
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
* Crystal SPICE subcircuit
|
|
* Butterworth-Van Dyke equivalent circuit model
|
|
*
|
|
* The crystal is modeled as:
|
|
* - Series RLC branch (motional components): Lm, Cm, Rm
|
|
* - Parallel capacitance: Cp (shunt/holder capacitance)
|
|
*
|
|
* Parameters:
|
|
* FREQ - Resonant frequency in Hz
|
|
* Lm - Motional inductance (default calculated from frequency)
|
|
* Cm - Motional capacitance (default: 10fF typical for MHz crystals)
|
|
* Rm - Motional resistance/ESR (default: 50 ohms)
|
|
* Cp - Parallel/shunt capacitance (default: 3pF)
|
|
*
|
|
* Nodes:
|
|
* 1 - Terminal 1 (XIN)
|
|
* 2 - Terminal 2 (XOUT)
|
|
|
|
* 2-pin crystal model
|
|
.SUBCKT XTAL_2PIN 1 2 PARAMS: FREQ=10e6 Cm=10f Rm=50 Cp=3p
|
|
* Calculate Lm from frequency: Lm = 1/(4*pi^2*f^2*Cm)
|
|
.PARAM Lm={1/(4*3.14159*3.14159*FREQ*FREQ*Cm)}
|
|
* Series RLC branch (motional components)
|
|
Lmot 1 3 {Lm}
|
|
Cmot 3 4 {Cm}
|
|
Rmot 4 2 {Rm}
|
|
* Parallel capacitance (holder/shunt capacitance)
|
|
Cpar 1 2 {Cp}
|
|
.ENDS XTAL_2PIN
|
|
|
|
* 4-pin crystal model with grounded case
|
|
.SUBCKT XTAL_4PIN 1 2 3 PARAMS: FREQ=10e6 Cm=10f Rm=50 Cp=3p Ccase=1p
|
|
* Calculate Lm from frequency
|
|
.PARAM Lm={1/(4*3.14159*3.14159*FREQ*FREQ*Cm)}
|
|
* Series RLC branch (motional components)
|
|
Lmot 1 4 {Lm}
|
|
Cmot 4 5 {Cm}
|
|
Rmot 5 2 {Rm}
|
|
* Parallel capacitance
|
|
Cpar 1 2 {Cp}
|
|
* Case capacitances to ground (pin 3)
|
|
Ccase1 1 3 {Ccase}
|
|
Ccase2 2 3 {Ccase}
|
|
.ENDS XTAL_4PIN
|