I have this circuit in LTSpice to test a PMOS model:
and this matlab function that implements a basic pmos with the characteristics equations:
V_th = 1;
lambda = 0;
K = 1.6*10^(-3);
if v_gs > V_th
I_d = 0;
elseif (v_gs <= V_th) && (v_ds > v_gs - V_th)
I_d = K * ((v_gs - V_th) * (v_ds) - ((v_ds^2)/2)) * (1 + lambda * abs(v_ds));
elseif (v_gs <= V_th) && (v_ds <= v_gs - V_th)
I_d = 1/2 * K * (v_gs - V_th)^2 * (1 + lambda * abs(v_ds));
end
If i plot both the IV characteristics i notice that the "matlab" pmos switch off as expected but the LTSpice one no. (dashed - LTSpice, solid - Matlab)
How can I make the two identical in the IV-behaviour, where i am doing it wrong?
Thanks




Vtoneeds to be negative for enhancement PMOS. See built in LTspice help: ltwiki.org/LTspiceHelp/LTspiceHelp/M_MOSFET.htm \$\endgroup\$Isto zero:Is=0? This will remove the body diode from the SPICE implementation. \$\endgroup\$