|
From: gary <li...@la...> - 2006-12-21 07:00:06
|
This runs. I'm old school, not to mention old, so I run spice much like a batch job. Thus made "tran" into ".tran". I gather ngspice lets you run these interactively. ------------------------------------------------------- *inverter Vgs in 0 DC 5 PULSE 0 5 0 100u 100u 1m 2m Vdd dd 0 DC 5V R1 dd out 5k .tran 10u 10m 0 10u .plot v(out) plot v(in) * Zetex Xmos out in 0 2N7000 * * ZETEX 2N7000 Mosfet Spice Subcircuit Last revision 3/5/00 * .SUBCKT 2N7000 3 4 5 * Nodes D G S M1 3 2 5 5 MOD1 RG 4 2 343 RL 3 5 6E6 C1 2 5 23.5P C2 3 2 4.5P D1 5 3 DIODE1 * .MODEL MOD1 NMOS level=1 VTO=2.474 RS=1.68 RD=0.0 IS=1E-15 KP=0.296 +CBD=53.5P PB=1 LAMBDA=267E-6 .MODEL DIODE1 D IS=1.254E-13 N=1.0207 RS=0.222 .ENDS 2N7000 .END ----------------------------------------------------------------------- Daniel Cabrini Hauagge wrote: > Gary, > > Thanks for the advice but it was of no help. I've put the DC voltage > at Vgs because > ngspice was complaining that there was none. > > And by the way... this is not my homework :) I'm studding this on my > own, following > the video lectures that MIT makes available at the OCW site. > > On 12/21/06, gary <li...@la...> wrote: >> I'm assuming you are not in the course as the list owner might not like >> me doing your homework. The thing I spot that looks odd is the >> combination of "dc" in your vgs source. Assuming this parsed, I don't >> know how spice interprets that line. [which is why I did this as a post >> to the list rather than directly to you.] I suggest >> vgs in 0 pulse (0 5 0 100u 100u 1m 2m) >> or better yet >> vgs in 0 pulse (0 5 1m 100u 100u 1m 2m) >> I don't like to change the source at time zero, but prefer to see the >> settled circuit before I start the transient simulation. >> >> Your pull up should be 1k. > > I've put a 5k pull up so that I would get I_D=1mA, which was the value > I found in > the datasheet, but I'm not so sure I got the V_GS_th thing right. I > have also tried > the 1k that appears on the schematics of the course notes, but with no > improvement. > >> >> >> >> Daniel Cabrini Hauagge wrote: >>> Hello, >>> >>> I'm new to electronics and spice and I'm trying to simulate a simple >>> nmos inverter but my setup just doesn't seem to work. When I run the >>> simulation the output voltage stays at high level with some very small >>> spikes when the input changes (I guess this is due to the parasite >>> capacitors in the mosfet model). The only warning that ngspice gives >>> is that there is no level set for the mosfet, but seting the level to >>> 1, 2 or 3 didn't solve the problem. >>> >>> The input file I'm working on is this >>> >>> Title Trying to use MOSFET's in simulation >>> >>> .INCLUDE 2N7000.mod >>> >>> Vgs in 0 DC 5 PULSE 0 5 0 100u 100u 1m 2m >>> Vdd dd 0 DC 5V >>> R1 dd out 5k >>> * Zetex >>> Xmos out in 0 2N7000 >>> >>> .CONTROL >>> run >>> tran 10u 10m 0 10u >>> plot v(out) >>> plot v(in) >>> .ENDC >>> >>> .END >>> >>> The MOSFET model I'm using can be found here >>> http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fwww.zetex.com%2F3.0%2Fspice%2F2n7000.mod&ei=3gyKRYLtN4r2owLJ07SDDw&usg=__qD8BjNuCMI0VRztaP1SyJsusTb4=&sig2=D5dbHUWYoEe-1DeBVpauiA >>> >>> The datashet is here >>> http://www.google.com/url?sa=t&ct=res&cd=2&url=http%3A%2F%2Fwww.zetex.com%2F3.0%2Fpdf%2F2N7000.pdf&ei=3gyKRYLtN4r2owLJ07SDDw&usg=__9cXuGI67A1xQyzF-qIboRlcgMqA=&sig2=bZ1TCMt4tMEnXWYEk88FxA >>> >>> And the circuit I'm trying to model is this one >>> http://ocw.mit.edu/NR/rdonlyres/Electrical-Engineering-and-Computer-Science/6-002Circuits-and-ElectronicsFall2000/F0B2D731-3CBF-4762-851F-5299800C5300/0/demo07.pdf >>> >>> Any help would be greatly appreciated. >>> >>> Daniel Cabrini Hauagge >>> >>> ------------------------------------------------------------------------- >>> Take Surveys. Earn Cash. Influence the Future of IT >>> Join SourceForge.net's Techsay panel and you'll get the chance to share your >>> opinions on IT & business topics through brief surveys - and earn cash >>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >>> _______________________________________________ >>> Ngspice-users mailing list >>> Ngs...@li... >>> https://lists.sourceforge.net/lists/listinfo/ngspice-users >>> >>> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Ngspice-users mailing list >> Ngs...@li... >> https://lists.sourceforge.net/lists/listinfo/ngspice-users >> > > |