EEC112 FM Oscillator instructions: 1. Copy the return-ratio script file and name it "rr" (for return ratio). 2. Type "chmod 755 rr" to make the file executable. 3. Copy the template file (template.txt) and name it "osc" (for oscillator). 4. Edit "osc" to put in your oscillator circuit in the space provided. Most of it is already in place, but you have to define the parameters c2 and c3. 5. Copy the model files for the transistors, t2n2222.inc and t2n2369.inc. 6. Type "chmod 755 t2n2222.inc t2n2369.inc" to make the files executable. 7. To run HSPICE on the edited "osc" file, type hspice osc > ! osc.out a. If you have never run hspice on a departmental computer, you have to run the command "setup hspice" once before you can run hspice. Some students have run hspice in earlier classes and do not need to run the setup command again. This command sets some environmental variables and the required path name. b. Note that the "!" character causes any previous "osc.out" file to be overwritten. c. Note that the model files for the transistors must be in the same directory in which the simulation is run. 8. To calculate the return ratio from the hspice output, type "./rr". The "rr" script will assume that the input file name is "osc.out" unless you tell it otherwise. It will generate an output file "osc.out.rr", which contains the magnitude and phase of the return ratio (rrm and rrp, respectively). Also, "rr" will call the program xgraph and plot the magnitude and phase of the return ratio. Look for the point when the phase jumps between -180 degrees and 180 degrees. Since -180 degrees = 180 degrees, and since the return ratio is assumed to be negative for negative feedback, your oscillator will start oscillating at the frequency where the phase of the return ratio = 180 degrees if the magnitude of the return ratio is greater than one (0 dB) at this frequency. HSPICE will also run a transient analysis on your oscillator. You should look in the "osc.out" file to see the results of the transient simulation. 9. Repeat steps 7 and 8 with revised oscillator circuits as often as necessary to meet the specifications. 10. To plot a waveform using cscope, type "cscope" If you have never run cscope on a departmental computer, you have to run the command "setup cscope" once before you can run cscope. 11. Follow the directions for first-time use of this program if appropriate. 12. Click on the folder icon This opens a new small window for "Open Plotfiles, Graphs, or Outlines" 13. In the new window, click on the file you'd like to plot. For example, click on osc.tr0 to look at the transient response. 14. Click "Open" 15. This opens two new windows, one called Signal Manager and the other called osc.tr0. 16. In the osc.tr0 window, click on the waveform you'd like to plot. For example, click on v(vout) 17. Click "Plot"