.title KiCad schematic
.include "/media/sf_DebianGlobal/KiCad/KiSimTests/Subcuircuits_Intern/Subckts_UC1825/Subckts_UC1825.lib"
.op
.probe alli
.control
save all
tran 10n 200u 
plot v(q)+8 v(qb)/5+6 v(r)/5+4 v(s)/5+2 v(/gq_int1)/5
.endc
.param VDD=5
.param VSS=0	
.param VTHRESH=0.5
.IC V(/QINT)={VSS}
CDUMMY2 QB 0 1n
E2 /QBR 0 /eqb_int1 0 1 
B2 /eqb_int1 0 V={IF( V(Q) > {VTHRESH}, {VSS},{VDD})}
V_Testset2 R 0 PULSE( 0 5 50u 10n 10n 10u 100u ) 
R1 0 Q 10k
RQB1 /QBR QB 1
R2 0 QB 10k
RQINT1 /QINT 0 1000Meg
CQINT1 /QINT 0 1n
B1 /gq_int1 0 V= {IF(V(S) > {VTHRESH},5,IF(V(R)>{VTHRESH},-5, 0))}
G1 /QINT 0 /gq_int1 0 1 
XD10 /QINT /MY5 D_D1
XD11 /MYVSS /QINT D_D1
V1 /MY5 0 DC {VDD} 
RQQ1 /QQQD1 Q 1
V_Testset1 S 0 PULSE( 0 5 0 10n 10n 10u 100u ) 
XU1 /QQQ /QQQD1 BUF_BASIC_GEN
E1 /QQQ 0 /QINT 0 1 
V2 /MYVSS 0 DC {VSS} 
CDUMMY1 Q 0 1n
.end
