Tuesday, April 6, 2021

Adding a pot to spice.


 symbol file .ASY

*************

Version 4
SymbolType CELL
LINE Normal 0 -36 0 -48
LINE Normal 0 48 0 36
LINE Normal -20 -3 -9 0
LINE Normal -20 3 -9 0
LINE Normal -20 3 -20 -3
LINE Normal 9 -36 0 -36
LINE Normal 9 36 9 -36
LINE Normal -9 36 9 36
LINE Normal -9 -36 -9 36
LINE Normal 0 -36 -9 -36
LINE Normal -32 0 -20 0
CIRCLE Normal -6 32 1 25
WINDOW 0 16 -32 Left 0
WINDOW 3 17 -1 Left 0
WINDOW 123 16 26 Left 0
SYMATTR Value R=10k
SYMATTR Value2 T=.5
SYMATTR Prefix X
SYMATTR SpiceModel pot
SYMATTR ModelFile ..\sym\EXTRA\Misc\pot.lib
SYMATTR Description Potentiometer
PIN 0 -48 NONE 0
PINATTR PinName A
PINATTR SpiceOrder 1
PIN 0 48 NONE 8
PINATTR PinName B
PINATTR SpiceOrder 2
PIN -32 0 NONE 0
PINATTR PinName C
PINATTR SpiceOrder 3

*******************

Model - .lib file.

 

 .SUBCKT pot 1 2 3
.param tap=limit(T,.001,.999)
R0 1 3 {R*(1-tap)}
R1 3 2 {R*tap}
.ENDS

******************

 

*NOTE.

The ASY file defines the lib file location. Spice will look for the lib file in your lib directory. To allow spice to find the file either place it in the lib directory or modfy the line in the ASY file to locate it.

 

 


No comments:

Post a Comment