Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DC transfer #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions examples/diff_amp/BC547A.PRM
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
*
.MODEL QBC547A NPN(
+ IS=1.533E-14
+ NF=1.002
+ ISE=7.932E-16
+ NE=1.436
+ BF=178.7
+ IKF=0.1216
+ VAF=69.7
+ NR=1.004
+ ISC=8.305E-14
+ NC=1.207
+ BR=8.628
+ IKR=0.1121
+ VAR=44.7
+ RB=1
+ IRB=1E-06
+ RBM=1
+ RE=0.6395
+ RC=0.6508
+ XTB=0
+ EG=1.11
+ XTI=3
+ CJE=1.61E-11
+ VJE=0.4209
+ MJE=0.3071
+ TF=4.995E-10
+ XTF=139
+ VTF=3.523
+ ITF=0.7021
+ PTF=0
+ CJC=4.388E-12
+ VJC=0.2
+ MJC=0.2793
+ XCJC=0.6193
+ TR=1E-32
+ CJS=0
+ VJS=0.75
+ MJS=0.333
+ FC=0.7762 )
*
22 changes: 22 additions & 0 deletions examples/diff_amp/control.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
* Note that inside control block the commands order is relevant

.control
* set variables
set noaskquit
set filetype=ascii ; rawspice.raw (see `write` command) in ascii format
set nobreak ; output.log won't page break data
set noacct

options NOINIT NOMOD

* DC transfer characteristic:
* - vary input voltage from -1V to 1V in steps of 0.1V
dc v1 -1 1 0.1

run ; run the actual simulation

* raw file path can be specified with -r flag: ngspice -r data.raw
* it defaults to ./rawspice.raw if a path is not specified with -r.
write
quit
.endc
24 changes: 24 additions & 0 deletions examples/diff_amp/main.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
AoE 2_13 differential amplifier
* this is 2_13.cir file
* supply voltage resources
vp 77 0 dc 15V
vn 88 0 dc -15V
* input voltages
v1 1 0 dc 0.8V
v2 2 0 dc 0
* bipolar transistors
q1 77 1 11 QBC547A
q2 22 2 21 QBC547A
*emitter resistors
re1 11 20 1k
re2 21 20 1k
*collector resistor
rc 77 22 75k
*common emitter resistor
r1 20 88 75k

* model for a pnp transistors
.include BC547A.PRM

.end

Loading