15.1 BJT characterisation CW121004-04.CIR **** CIRCUIT TOPOLOGY DEFINITION SECTION VCE C 0 DC 2V Vammeter M B 0V IB 0 M DC 0 Q1 C B 0 BC107BP **** SEMICONDUCTOR MODELS .INCLUDE PHY2028.LIB **** COMMANDS SECTION * Insert interactive commands into the source using: .control echo "Processing..." * Run a .DC analysis and print the name of the active plot. Use 1.001mA as terminal * value as otherwise Spice misses out last value due to rounding errors. echo "The next two errors can be ignored.:" dc vce 0V 2V 25mV ib 0mA 1.001mA 100uA * There are 11 ib values times 81 vce values so rearrange vector into [11,81] matrix, * this trick prevents 'flyback lines' spoiling the plot. reshape c vce#branch [11] * now plot current into collector vs collector voltage for 11 different base currents: plot (-i(vce)) vs v(c)[0] echo " $curplot: DC analysis of BC107BP completed" * Next, calculate IC vs IB with VCE set to 2V dc ib 0mA 1mA 10uA * for some reason (bug?) the sweep vector is given type 'voltage' although it contains * currents.Hence use a zero-voltage source as ammeter to measure base current. plot (-i(vce)) vs i(vammeter) xlabel I(base) echo " $curplot: IC vs IB analysis of BC107BP completed" * * End interactive commands with: echo "Done." .endc * The last line in the file must always be: .END