Jon,
...For example, if I select 2N6028 in the drop-down
for SpiceModel *and* then manually change the Value
attribute to match, everything works well...
You probably want to make the Model and Instance name
visible in the .asy file and nothing else. THE VALUE
SHOULD BE LEFT BLANK in both the .asy and instance,
unless you want to add parameters to pass to the
subckt. These should be of the form "eta=5.3"
Attached is a .asy file and .sub file that work
together
to demonstate being able to use the drop list to
to select a subckt in the .sub file. You will have
to fix line wrap.
--- .asy ---
Version 4
SymbolType CELL
LINE Normal -32 -32 32 0
LINE Normal -32 32 32 0
LINE Normal -32 -32 -32 32
LINE Normal -28 -16 -20 -16
LINE Normal -28 16 -20 16
LINE Normal -24 20 -24 12
LINE Normal 0 -32 0 -16
LINE Normal 0 32 0 16
LINE Normal 4 -20 12 -20
LINE Normal 8 -24 8 -16
LINE Normal 4 20 12 20
WINDOW 0 16 -32 Left 0
WINDOW 38 47 28 Center 0
SYMATTR Prefix X
SYMATTR Description Parameterized Single Pole Opamp.
En and in are equivalent voltage and current noises.
Enk and ink are the respective corner frequencies.
SYMATTR Value2 Avol=10Meg GBW=10Meg Slew=10Meg
SYMATTR SpiceLine ilimit=25m rail=0 Vos=0
SYMATTR SpiceLine2 en=0 enk=0 in=0 ink=0
SYMATTR ModelFile genopamp.sub
SYMATTR SpiceModel 1pole
PIN -32 16 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 1
PIN -32 -16 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN 0 -32 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 3
PIN 0 32 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 32 0 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5
--- .sub ---
* Copyright Linear Technology Corp. 1998, 1999,
2000, 2001, 2002, 2003. All rights reserved.
*
.subckt 1pole 1 2 3 4 5
S1 5 3 N002 5 Q
S2 4 5 5 N002 Q
A1 2 1 0 0 0 0 N002 0 OTA G={Avol/Rout} ref={Vos}
Iout={slew*Cout} Cout={Cout} en={en} enk={enk} in={in}
ink={ink} Vhigh=1e308 Vlow=-1e308
C3 5 4 1p
C4 3 5 1p
S3 N002 0 4 N002 C
S4 0 N002 N002 3 C
R2 N002 4 {2*Rout} noiseless
R1 3 N002 {2*Rout} noiseless
R3 3 1 1G noiseless
R4 3 2 1G noiseless
R5 2 4 1G noiseless
R6 1 4 1G noiseless
.model C SW(Ron=100 Roff=1T Vt=0 Vh=-1 noiseless)
.param Rout=100Meg
.param Cout={Avol/GBW/2/pi/Rout}
.model Q SW(Ron=10 Roff=10Meg Vt=0 Vh=-.1 Vser={Rail}
ilimit={Ilimit} noiseless)
.param Avol=10Meg GBW=10Meg Slew=10Meg ilimit=25m
rail=0 Vos=0
.param en=0 enk=0 in=0 ink=0
.ends 1pole
.subckt 2pole 1 2 3 4 5
S1 5 3 N002 5 Q
S2 4 5 5 N002 Q
A1 2 1 0 0 0 0 N003 0 OTA G={Avol/Rout} ref={Vos}
Iout={slew*Cout} Cout={Cout} en={en} enk={enk} in={in}
ink={ink} Vhigh=1e308 Vlow=-1e308 Rout={Rout}
C3 5 4 1p
C4 3 5 1p
S3 N002 0 4 N002 C
S4 0 N002 N002 3 C
R3 3 2 1G noiseless
G1 0 N002 N003 0 {1/Rout}
R1 3 N002 {2*Rout} noiseless
R2 N002 4 {2*Rout} noiseless
C1 N002 0 {X*Cout/Avol}
S5 0 N003 N003 3 C
S6 N003 0 4 N003 C
R4 3 1 1G noiseless
R5 1 4 1G noiseless
R6 2 4 1G noiseless
.model C SW(Ron=100 Roff=1T Vt=0 Vh=-1 noiseless)
.param Rout=100Meg
.param Cout={Avol/GBW/2/pi/Rout}
.model Q SW(Ron=10 Roff=10Meg Vt=0 Vh=-.1 Vser={Rail}
ilimit={Ilimit} noiseless)
.param Avol=10Meg GBW=10Meg Slew=10Meg rail=0 Vos=0
ilimit=25m
.param en=0 enk=0 in=0 ink=0 phimargin=45
.param X
table(phimargin,29.4,3.5,32.1,2.9,33.8,2.6,35.8,2.3,38.1,2,40.9,1.7,43.2,1.5,45.9,1.3,49.2,1.1,53.2,0.9,58.2,0.7,64.7,0.5,73,0.3,86.1,0.05)
.ends 2pole
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!