X-Authentication-Warning: delorie.com: mail set sender to geda-help-bounces using -f X-Recipient: geda-help AT delorie DOT com X-Virus-Scanned: amavisd-new at cloud9.net Date: Wed, 29 Oct 2014 09:55:23 -0400 (EDT) From: Stuart Brorson To: geda-help AT delorie DOT com Subject: Re: [geda-help] newbie: automatic way to find a model In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Reply-To: geda-help AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-help AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk The automated way to find SPICE models is to use Google. A very quick search on "2N2222 spice model" turns up lots of hits, including this one: http://www.onsemi.com/pub/Collateral/2N2222A.LIB.TXT Have fun with electronics, Stuart On Thu, 30 Oct 2014, Jack Andrews wrote: > Hi, > > My interest is > - bread-boarding some hardware ideas > - saving time messing with hardware by using simulation > > So I ended up looking at [ng]spice and gschem > > This is my first day and I'm quite pleased with my progress - all credit > due to gEDA. > > I drew up the start of a current mirror in gschem and > > $ gnetlist -v -g spice-sdb current-mirror #see current mirror in shell > script below > > and the body of the output was: > > B2 5 7 0V > R4 1 unconnected_pin-1 7 5K > B1 7 6 12V > Q1 2 2 6 unknown > Q2 4 2 6 unknown > R3 3 5 5K > R2 4 3 10K > R1 2 1 10K > .end > > In my schematic, I specified Q{1,2} as 2N2222 - but to run ngspice, I seem > to need to find the model for 2N2222. I'm sure the question has been asked > before: > > . is there an automated way to find the model for 2N2222? > > If this is currently done manually, I'd like to contribute some work. (I'm > in software by day). > > Also, note the R4 VARIABLE_RESISTOR is being used as a variable resistor > (not a potentiometer) so there is a floating node. What is the best way of > drawing what I want? And then, how do I get spice to vary the resistor in > 33 steps? Maybe use a VCR voltage-controlled-resistor and vary the voltage > control? Starting to get vague now... > > I'm very encouraged by gschem and looking forward to spending some time > learning spice and the gEDA. > > current-mirror appended below. > > Regards, > > > Jack > > v 20130925 2 > C 40000 40000 0 0 0 title-B.sym > C 50000 44500 1 90 0 resistor-1.sym > { > T 49600 44800 5 10 0 0 90 0 1 > device=RESISTOR > T 49700 44700 5 10 1 1 90 0 1 > refdes=R1 > T 50300 44600 5 10 1 1 90 0 1 > value=10K > } > C 51200 44500 1 90 0 resistor-1.sym > { > T 50800 44800 5 10 0 0 90 0 1 > device=RESISTOR > T 50900 44700 5 10 1 1 90 0 1 > refdes=R2 > T 51400 44700 5 10 1 1 90 0 1 > value=10K > } > C 51200 45400 1 90 0 resistor-1.sym > { > T 50800 45700 5 10 0 0 90 0 1 > device=RESISTOR > T 50900 45600 5 10 1 1 90 0 1 > refdes=R3 > T 51400 45600 5 10 1 1 90 0 1 > value=5K > } > C 50500 43500 1 0 0 2N2222-1.sym > { > T 51400 44200 5 10 0 0 0 0 1 > device=2N2222 > T 51400 44000 5 10 1 1 0 0 1 > refdes=Q2 > } > C 50500 43500 1 0 1 2N2222-1.sym > { > T 49600 44200 5 10 0 0 0 6 1 > device=2N2222 > T 49600 44000 5 10 1 1 0 6 1 > refdes=Q1 > } > N 49900 44500 50500 44500 4 > N 50500 44500 50500 44000 4 > N 48400 43500 51100 43500 4 > N 48400 43500 48400 44800 4 > C 48200 45500 1 270 0 battery-1.sym > { > T 49100 45200 5 10 0 0 270 0 1 > device=BATTERY > T 49500 45200 5 10 0 0 270 0 1 > symversion=0.1 > T 47900 45000 5 10 1 1 0 0 1 > value=12V > T 47900 45300 5 10 1 1 0 0 1 > refdes=B1 > } > C 50000 45400 1 90 0 resistor-variable-1.sym > { > T 49100 46200 5 10 0 0 90 0 1 > device=VARIABLE_RESISTOR > T 49400 45600 5 10 1 1 0 0 1 > value=5K > T 49600 46000 5 10 1 1 90 0 1 > refdes=R4 > } > N 48400 45500 48400 46900 4 > N 48400 45900 49400 45900 4 > N 51100 46900 51100 46300 4 > N 50000 46900 48400 46900 4 > C 50700 46700 1 0 1 battery-1.sym > { > T 50400 47600 5 10 0 0 0 6 1 > device=BATTERY > T 50600 46500 5 10 1 1 0 6 1 > refdes=B2 > T 50400 48000 5 10 0 0 0 6 1 > symversion=0.1 > T 50300 46500 5 10 1 1 0 6 1 > value=0V > } > N 51100 46900 50700 46900 4 >