set ylabel "Charge or discharge time [microsec]" set xlabel "Pull-up resistance [ohm]" set samples 10000 charge_time(r,c,V0,Vinf,Vth) = 1e6* r*c* log( (V0-Vinf) / (Vth-Vinf)) set xrange[100:4000] set yrange [0.01:10] set logscale x set logscale y set key top left Vsupply=6 # power supply is +- Vsupply Isat = 0.018 # saturation current of open-collector comparator set title \ sprintf("LM2903, +-%.3gV power, time to (dis)charge FET gates to threshold",\ Vsupply) # Threshold voltage(s) and capacitance for nFET Vntsmall=1.5 Vntbig=2.5 Cn=675e-12 # Threshold voltage(s) and capacitance for pFET Vptbig=-4.0 Vptsmall=-2.8 Cp=750e-12 plot \ charge_time(x,Cn,2*Vsupply-x*Isat,2*Vsupply,Vntbig) title "nFET on big",\ charge_time(x,Cn,2*Vsupply-x*Isat,2*Vsupply,Vntsmall) title "nFET on small",\ charge_time(x,Cn,2*Vsupply,2*Vsupply-x*Isat,Vntbig) title "nFET off big",\ charge_time(x,Cn,2*Vsupply,2*Vsupply-x*Isat,Vntsmall) title "nFET off big",\ charge_time(x,Cp,0,-x*Isat,Vptbig) title "pFET on big",\ charge_time(x,Cp,0,-x*Isat,Vptsmall) lt 8 title "pFET on small",\ charge_time(x,Cp,-x*Isat,0,Vptbig) title "pFET off big", \ charge_time(x,Cp,-x*Isat,0,Vptsmall) title "pFET off small"