0

I've been trying to use a macromodel for an ion sensitive field effect transistor made for Hspice using LTspice, but the code won't run properly and it's showing some errors. Unfortunately, I am not familiar with either of the two software (I was forced to use simulations since I have no access to the actual transistor for my thesis during this pandemic); it was just yesterday when I started using it, and I kind of have no time to learn about using it.

The code was acquired from this article: https://doi.org/10.1016/S0925-4005(99)00377-9

Take note I just copied the code manually from the paper, as directly copying from a PDF source isn't working. it is a huge possibility that there's a typographical/syntax error which could be entirely my fault.

Code that i've manually copied:

**************************************************
FILE: ISFET MACROMODEL
*****************************************************************************************************
* Behavioral macromodel for the ISFET with two
* kinds of binding sites: silanol and amine sites
* By Sergio Martinoia and Giuseppe Massobrio
* Bioelectronics Laboratory, Dept. of Biophysical and Electronics Eng.
* Via Opera Pia 11A, 16145, Genova, ITALY
* email: giaser@dibe.unige.it
* September 1998
*****************************************************************************************************
* PARAMETER LIST
* General constants:
* q = electronic charge [C]
* k = Boltzmann's constant [J/K]
* T = Absolute temperature [K]
* NAv = Avogadro's constant [1/mole]
* ISFET geometrical parameters:
* dihp = distance between the Inner Helmholtz Plane (IHP) and the ISFET surface [m]
* dohp = distance between the Outer Helmholtz Plane (OHP) and the ISFET surface [m]
* ISFET electrochemical parameters:
* Ka = positive dissociation constant [mole/1]
* Kb = negative dissociation constant [mole/1]
* Kn = dissociation constant for amine sites [mole/1]
* Nsil = silanol (or oxide) surface site density [#/m2]
* Nnit = amine surface site density [#/m2]
* Cbulk = electrolyte concentration [1/moles]
* epsihp = relative permittivity of the Inner Helmholtz layer
* epsohp = relative permittivity of the Outer Helmholtz layer
* epsw = relative permitivitty of the bulk electrolyte solution
* Reference-electrode electrochemical parameters:
* Eabs = absolute potential of the standard hydrogen electrode [V]
* Erel = potential of the ref. electrode (Ag/AgCl) relative to the hydrogen electrode [V]
* Phim = work function of the metal back contact / electronic charge [V]
* Philj = liquid-junction potential difference between the ref. solution and the electrolyte [V]
* Chieo = surface dipole potential [V]
*****************************************************************************************************
.OPTION LIST ingold = 0 post probe
+ absmos = 1e-15 dcstep = 1000 nopiv
+ absv = 1e-15 relv = 1e-12 absi = 1e-15
+ gmindc = 1e-24 itl1 = 1000 converge accurate
+ method = gear lvltim = 2 itl5 = 1000 delmax = 1e-15
+ dv = 0.2
.PARAM
+ k = 1.38e-23 T = 300 eps0 = 8.85e-12
+ Ka = 15.8 Kb = 63.1e-9 Kn = 1e-10
+ Nsil = 3.0e18 Nnit = 2.0e18
+ Cbulk = 0.1
* Beginning of the sub-circuit definition
*=============================================
.SUBCKT ISFET 6 1 3 4 101
*drain|ref.el|source|bulk|pH input
+ q = 1.6e-19 Nav = '6.023e23*1e3'
+ epsw = 78.5 epsihp = 32 epsohp = 32
+ dihp = 0.1n dohp = 0.3n Cbulk = 0.1
+ Eabs = 4.7 Phim = 4.7 Erel = 0.200 Chieo = 3e-3 Philj = 1e-3
+ ET = 'q/(k*T)'
+ sq = 'sqrt(8*eps0*epsw*k*T)'
+ Cb = 'NAv*Cbulk'
+ KK = 'Ka*Kb'
+ Ch = '((eps0*epsihp*epsohp)/(epsohp*dihp + epsihp*dohp))'
+ Cd = '(sq*ET*0.5)*sqrt(Cb)'
+ Ceq = '1/(1/Cd + 1/Ch)'
Eref 1 10 VOL = 'Eabs-Phim-Erel+Chieo+Philj'
Ceq 10 2 C = '1/(1/Cd+1/Ch)'
EP1 46 0 VOL = 'log(KK)+4.6*V(101)'
RPI 46 0 1G
EP2 23 0 VOL = 'log(Ka)+2.3*V(101)'
RP2 23 0 1G
EPH 2 10 VOL = '(q/Ceq)*(Nsil*((exp(-2*V(2,10)*ET)-exp(V(46)))/(exp(-2*V(2,10)*ET)+exp(V(23))*exp(-1*V(2,10)*ET)+exp(V(46))))+Nnit*((exp(-1*V(2,10)*ET))/(exp(-1*V(2,10)*ET)+(Kn/Ka)*exp(V(23)))))'
RpH 101 0 1K
MIS 6 2 3 4 MISFET L = 18u W = 804u NRS = 5 NRD = 5
******************************************************************************************************
.MODEL MISFET NMOS LEVEL = 2
+ VTO = 7.99E - 01 LAMBDA = 7.59E - 03 RSH = 3.5E + 01 TOX = 86E - 9
+ UO = 6.53E + 02 TPG = 0
+ UEXP = 7.64E - 02 NSUB = 3.27E + 15 NFS = 1.21E + 11
+ NEFF = 3.88 VMAX = 5.35E + 04 DELTA = 1.47 LD = 2.91E - 06
+ UCRIT = 7.97E + 04 XJ = 6.01E - 09 CJ = 4.44E - 4 IS = 1E-11
+ CJSW = 5.15E - 10 PHI = 5.55E - 01 GAMMA = 9.95E-01
+ MJ = 0.395 MJSW = 0.242 PB = 0.585
******************************************************************************************************
.ENDS ISFET
*=============================================
*Beginning of the example circuit
XIS 100 1 0 0 200 ISFET
Vbias 1 0 DC 1.5
VpH 200 0 DC 10
Vd 110 0 DC 0.5
Vid 110 100 DC 0
.OP debug
.DC Vbias 0.0 4 0.1
.PRINT DC V(1,XIS.2) V(XIS.2,0) V(XIS.23) V(XIS.46) V(1) I(Vid)
.PROBE DC V(1,XIS.2) V(XIS.2,0) V(XIS.23) V(XIS.46) V(1) I(Vid)
.END

And here below is the error log:

Circuit: **************************************************

Questionable use of curly braces in "ep1 46 0 vol = {log(kk)+4.6*v(101)}"
    Error: undefined symbol in: "log(kk)+4.6*[v](101)"
Questionable use of curly braces in "ep2 23 0 vol = {log(ka)+2.3*v(101)}"
    Error: undefined symbol in: "log(ka)+2.3*[v](101)"
Questionable use of curly braces in "eph 2 10 vol = {(q/ceq)*(nsil*((exp(-2*v(2,10)*et)-exp(v(46)))/(exp(-2*v(2,10)*et)+exp(v(23))*exp(-1*v(2,10)*et)+exp(v(46))))+nnit*((exp(-1*v(2,10)*et))/(exp(-1*v(2,10)*et)+(kn/ka)*exp(v(23)))))}"
    Error: undefined symbol in: "(q/ceq)*(nsil*((exp(-2*[v](2,10)*et)-exp(v(46)))/(exp(-2*v(2,10)*et)+exp(v(23))*exp(-1*v(2,10)*et)+exp(v(46))))+nnit*((exp(-1*v(2,10)*et))/(exp(-1*v(2,10)*et)+(kn/ka)*exp(v(23)))))"
Error on line 65 : c:is:eq is:10 is:2 c =  0.356817975854934 
     Unable to find definition of model "c"
Error on line 66 : e:is:p1 is:46 0«:0» is:vol is:= log(kk)+4.6*v(200))
     Unknown parameter "log"
Error on line 68 : e:is:p2 is:23 0«:0» is:vol is:= log(ka)+2.3*v(200))
     Unknown parameter "log"
Error on line 70 : e:is:ph is:2 is:10 is:vol is:= q/ceq)*(nsil*((exp(-2*v(is:2,is:10)*et)-exp(v(is:46)))/(exp(-2*v(is:2,is:10)*et)+exp(v(is:23))*exp(-1*v(is:2,is:10)*et)+exp(v(is:46))))+nnit*((exp(-1*v(is:2,is:10)*et))/(exp(-1*v(is:2,is:10)*et)+(kn/ka)*exp(v(is:23))))))
     Unknown parameter "q/ceq"
Fatal Error: .option syntax error, unrecognized option: "absmos"
TTbulaski
  • 335
  • 2
  • 8
  • You need to include the **exact** and **complete** text of the error messages from LTspice. Also show us the schematic you created in LTspice. – Elliot Alderson Jun 03 '20 at 20:02
  • 1
    @ElliotAlderson I am not sure if I understand what you meant, but my goal was to add a third party component in LTSpice. I have no schematic diagrams of an actual circuit yet. I have added an error log at the bottom of the post. Thank you very much for your comment! – TTbulaski Jun 04 '20 at 04:18

1 Answers1

1

This is what I found:

  • the .OPTIONS part is incompatible with LTspice, except two of them, so it needs to be commented out (put a ;, *, or # in front of the line).
  • the first block of .PARAMs is out of scope and is not passed down into the subcircuit level, so the whole part needs to be moved inside the .SUBCKT definition.
  • q and k are bultin variables, so they don't need to be redefined, but it won't hurt, either.
  • all the sources (Exxx) that have VOL = need to be replaces with behavioural sources (Bxxx) with V =. Curly braces are not needed since anything inside the behavioural expression is understood to be an evaluation. The same goes for .PARAM statements.
  • the .MODEL definition is ill-formed because it contains spaces between the values and the exponents, i.e. 1 e 2, instead of 1e2. All the values need to be corrected. Spaces between the variables and equal, and between equal and value, are ignored (i.e. x = 1.618).
  • .PRINT and .PROBE are understood by LTspice, but largely ignored, they're there for compatibility, I think; it's safe to comment them out.
  • not lastly, the first non-commented line, with FILE : ..., needs to be commented out, too.
  • (optional) the single quotes are the equivalent of the curly braces and are understood by LTspice, so they don't need changing. As the schematic is now it's because of an obscure error (point #5) that crept up so I changed everything methodically until I found the culprit, then I didn't change them back.

You can keep everything as it is now and simply run it, but if you plan to add anything afterwards, don't forget that there is an .END (not .ENDS) at the end of the text block, which signifies the literal end of everything in the schematic. To avoid this, I used the symbol for the pentode (it has 5 pins) and wired them to external, visible sources (while commenting out the ones in the block of text). This is how it looks like:

test

And this is the content of the .asc file:

Version 4
SHEET 1 2368 2312
WIRE -80 1840 -320 1840
WIRE 16 1840 -80 1840
WIRE 16 1888 16 1840
WIRE -112 1968 -208 1968
WIRE -32 1968 -112 1968
WIRE -320 2000 -320 1840
WIRE -208 2000 -208 1968
WIRE -16 2080 -16 2016
WIRE -224 2160 -288 2160
WIRE -176 2160 -224 2160
WIRE -16 2160 -16 2080
WIRE -16 2160 -96 2160
WIRE -288 2192 -288 2160
FLAG -16 2080 100
FLAG -112 1968 1
FLAG 64 1952 0
FLAG -32 1936 0
FLAG -80 1840 200
FLAG -208 2080 0
FLAG -320 2080 0
FLAG -288 2272 0
FLAG -224 2160 110
SYMBOL Misc\\pentode 16 1952 R0
SYMATTR InstName U1
SYMATTR Value ISFET
SYMBOL voltage -208 1984 R0
SYMATTR InstName Vbias
SYMATTR Value 1.5
SYMBOL voltage -320 1984 R0
SYMATTR InstName Vph
SYMATTR Value 10
SYMBOL voltage -288 2176 R0
SYMATTR InstName Vd
SYMATTR Value 0.5
SYMBOL voltage -80 2160 R90
WINDOW 0 -32 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName Vid
SYMATTR Value ""
TEXT 208 24 Left 2 !**************************************************\n;FILE: ISFET MACROMODEL\n*****************************************************************************************************\n* Behavioral macromodel for the ISFET with two\n* kinds of binding sites: silanol and amine sites\n* By Sergio Martinoia and Giuseppe Massobrio\n* Bioelectronics Laboratory, Dept. of Biophysical and Electronics Eng.\n* Via Opera Pia 11A, 16145, Genova, ITALY\n* email: giaser@dibe.unige.it\n* September 1998\n*****************************************************************************************************\n* PARAMETER LIST\n* General constants:\n* q = electronic charge [C]\n* k = Boltzmann's constant [J/K]\n* T = Absolute temperature [K]\n* NAv = Avogadro's constant [1/mole]\n* ISFET geometrical parameters:\n* dihp = distance between the Inner Helmholtz Plane (IHP) and the ISFET surface [m]\n* dohp = distance between the Outer Helmholtz Plane (OHP) and the ISFET surface [m]\n* ISFET electrochemical parameters:\n* Ka = positive dissociation constant [mole/1]\n* Kb = negative dissociation constant [mole/1]\n* Kn = dissociation constant for amine sites [mole/1]\n* Nsil = silanol (or oxide) surface site density [#/m2]\n* Nnit = amine surface site density [#/m2]\n* Cbulk = electrolyte concentration [1/moles]\n* epsihp = relative permittivity of the Inner Helmholtz layer\n* epsohp = relative permittivity of the Outer Helmholtz layer\n* epsw = relative permitivitty of the bulk electrolyte solution\n* Reference-electrode electrochemical parameters:\n* Eabs = absolute potential of the standard hydrogen electrode [V]\n* Erel = potential of the ref. electrode (Ag/AgCl) relative to the hydrogen electrode [V]\n* Phim = work function of the metal back contact / electronic charge [V]\n* Philj = liquid-junction potential difference between the ref. solution and the electrolyte [V]\n* Chieo = surface dipole potential [V]\n*****************************************************************************************************\n;.OPTION LIST ingold = 0 post probe\n;+ absmos = 1e-15 dcstep = 1000 nopiv\n;+ absv = 1e-15 relv = 1e-12 absi = 1e-15\n;+ gmindc = 1e-24 itl1 = 1000 converge accurate\n;+ method = gear lvltim = 2 itl5 = 1000 delmax = 1e-15\n;+ dv = 0.2\n;.PARAM\n;+ k = 1.38e-23 T = 300 eps0 = 8.85e-12\n;+ Ka = 15.8 Kb = 63.1e-9 Kn = 1e-10\n;+ Nsil = 3.0e18 Nnit = 2.0e18\n;+ Cbulk = 0.1\n* Beginning of the sub-circuit definition\n*=============================================\n.SUBCKT ISFET 6 1 3 4 101 params:\n*drain|ref.el|source|bulk|pH input\n+ q = 1.6e-19 Nav = 6.023e23*1e3\n+ epsw = 78.5 epsihp = 32 epsohp = 32\n+ dihp = 0.1n dohp = 0.3n Cbulk = 0.1\n+ Eabs = 4.7 Phim = 4.7 Erel = 0.200 Chieo = 3e-3 Philj = 1e-3\n+ ET = q/(k*T)\n+ sq = sqrt(8*eps0*epsw*k*T)\n+ Cb = NAv*Cbulk\n+ KK = Ka*Kb\n+ Ch = ((eps0*epsihp*epsohp)/(epsohp*dihp + epsihp*dohp))\n+ Cd = (sq*ET*0.5)*sqrt(Cb)\n+ Ceq = 1/(1/Cd + 1/Ch)\n.PARAM\n+ k = 1.38e-23 T = 300 eps0 = 8.85e-12\n+ Ka = 15.8 Kb = 63.1e-9 Kn = 1e-10\n+ Nsil = 3.0e18 Nnit = 2.0e18\n+ Cbulk = 0.1\n;Eref 1 10 VOL = 'Eabs-Phim-Erel+Chieo+Philj'\nVref 1 10 {Eabs-Phim-Erel+Chieo+Philj}\nCeq 10 2 {1/(1/Cd+1/Ch)}\n;EP1 46 0 VOL = 'log(KK)+4.6*V(101)'\nBp1 46 0 V=log(kk)+4.6*V(101)\n;EP2 23 0 VOL = 'log(Ka)+2.3*V(101)'\nBp2 23 0 V=log(Ka)+2.3*V(101)\n;EPH 2 10 VOL = '(q/Ceq)*(Nsil*((exp(-2*V(2,10)*ET)-exp(V(46)))/(exp(-2*V(2,10)*ET)+exp(V(23))*exp(-1*V(2,10)*ET)+exp(V(46))))+Nnit*((exp(-1*V(2,10)*ET))/(exp(-1*V(2,10)*ET)+(Kn/Ka)*exp(V(23)))))'\nBph 2 10 V=(q/Ceq)*(Nsil*((exp(-2*V(2,10)*ET)-exp(V(46)))/\n+ (exp(-2*V(2,10)*ET)+exp(V(23))*exp(-1*V(2,10)*ET)+exp(V(46))))+\n+ Nnit*((exp(-1*V(2,10)*ET))/(exp(-1*V(2,10)*ET)+(Kn/Ka)*exp(V(23)))))\nRpH 101 0 1K\nMIS 6 2 3 4 MISFET L = 18u W = 804u NRS = 5 NRD = 5\n******************************************************************************************************\n.MODEL MISFET NMOS LEVEL = 2\n+ VTO = 7.99E-01 LAMBDA = 7.59E-03 RSH = 3.5E+01 TOX = 86E-9\n+ UO = 6.53E+02 TPG = 0\n+ UEXP = 7.64E-02 NSUB = 3.27E+15 NFS = 1.21E+11\n+ NEFF = 3.88 VMAX = 5.35E+04 DELTA = 1.47 LD = 2.91E-06\n+ UCRIT = 7.97E+04 XJ = 6.01E-09 CJ = 4.44E-4 IS = 1E-11\n+ CJSW = 5.15E-10 PHI = 5.55E-01 GAMMA = 9.95E-01\n+ MJ = 0.395 MJSW = 0.242 PB = 0.585\n******************************************************************************************************\n.ENDS ISFET\n*=============================================\n*Beginning of the example circuit\n;XIS 100 1 0 0 200 ISFET\n;Vbias 1 0 DC 1.5\n;VpH 200 0 DC 10\n;Vd 110 0 DC 0.5\n;Vid 110 100 DC 0\n;.OP ; debug\n;.DC Vbias 0 4 0.1\n;.PRINT DC V(1,XIS.2) V(XIS.2,0) V(XIS.23) V(XIS.46) V(1) I(Vid)\n;.PROBE DC V(1,XIS.2) V(XIS.2,0) V(XIS.23) V(XIS.46) V(1) I(Vid)\n;.END
TEXT -48 2248 Left 2 !.op
TEXT -72 2296 Left 2 !.dc vbias 0 4 0.1
TEXT -32 2016 Left 2 ;1
TEXT -48 1960 Left 2 ;2
TEXT 72 1936 Left 2 ;3
TEXT -40 1912 Left 2 ;4
TEXT 0 1872 Left 2 ;5
a concerned citizen
  • 21,167
  • 1
  • 20
  • 40