Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Analog and Digital Simulation Lab Electronic Workbench Hints & Kinks 0. Create a folder in the Ewb5 directory with your name 1. Start Electronic Workbench (EWB) 2. File --> Save As : find the folder with your name, save the circuit with a reasonable name (such as "diff amp". Don't put any "." extension on it). 3. Circuit --> Schematic Options --> Show/Hide: check Show nodes, Show labels, Show values 4. Same menu, Wiring tab: check "Manual-route wires" -- click "OK" 5. "Basic" parts bin (with picture of resistor): Drag a couple of resistors, a couple of unpolarized capacitors, and a "connector dot" onto your schematic area. "Sources" parts bin (battery picture) has battery, ground, and AC voltage source (for input). Get one of each. 6. Right-click a component --> "component properties" bring up a box where you can change the value. Be sure units are what you want -- you can change them too. "Copy" and "Paste" to make as many copies as you need. 7. Right-click component --> "rotate" or "flip" to reorient.Analog simulation: 8. "Transistors" bin --> NPN transistor: drag one onto schematic area. Right Click --> "Component properties" allows you to select particular type: National 2N3904. Make copy and "Horizontal flip" it to get second transistor. 9. Arrange parts and wire them. Get cursor near enough to component lead that a dot appears, then left mouse down -- you need to hold it down until you've moved a little distance away from the connection, then you can let it up. Click once for each rightangle bend you want in the wire as you route it (NB: this only works if you've set manual routing -- item 4 above). You don't have to line up the bends exactly; it will align itself. "Connector dots" have four connection points around the edges -- watch where the black dots appear and use the one on the near side for good appearance. You can attach the second end of a wire to an existing wire: get close enough that a little circle appears, then click. To attach the first end to a wire, you need to add a connector dot, so whenever possible start your wire at the component. If you are not sure that a wire is really attached, try moving the component (good wires stay attached). 10. If you use coupling capacitors on outputs, they need to have a DC connection somewhere. Put 10-Meg resistors to ground to fix this. 11. Attach an AC voltage generator to each input. Set voltage, frequency, and phase to values appropriate for measuring differential or common-mode gain. 12. Get the Q-point bias values by "Analysis" --> "DC Operating Point" You can print out the resulting table for your notebook. 13. Transient Analysis: "Analysis" --> "Transient . . ." Select nodes you want to look at. You can color code them by double-clicking on the node number label on the schematic (this is worthwhile). Click "Simulate" to run transient analysis. (have "end time" set to 5 cylces) 14. "Analysis" --> "Display graphs" to see results. DC bias point is on first tab. Transient analysis on third. Click "toggle grid" and "toggle legend". You can resize graph by edges or corner, and move legend around. On print command (from top bar of this window) select pages you want to print -- they are numbered in same order as tabs. 15. You can also print out your schematic from bar above main menu. Check "Schematic" box. (check "x-y plot" to get scope display, other options are named more recognizably.) 16. "Analysis" —> "AC Frequency" to make Bode Plot (gain and phase vs frequency). Use log-log scales. This takes over the frequency settings of any AC voltage sources you have in the circuit. However, it does not preserve your 180-degree phase setting for differential input, so you'll need to ground the negative input and just use a single source on the plus input (the error due to the common mode component is small). Or you can use a transformer with a single AC voltage source — just as you did in the real lab. Look at both outputs and see if you can explain the differences at high frequencies (remember that the major high-frequency factor is the collector-base miller capacitance in the transistor). The generic transistor is "ideal" and won't show any high frequency effects — be sure you have the transistor properties set to 2N3904. Note that driving the transistor bases directly with ideal voltage sources has some strange effects on the transfer function, such as blocking the Miller effect. Try putting 500 ohm resistors in series with th voltage sources and look at the difference in the transfer functions. See if you can explain everything! Digital simulation: Use generic flip flops and gates of the illustrated types from the top row of the "Logic Gates" and "Digital" parts bins (with pictures of and gate and RS f/f). For the comparator, do NOT use the generic comparator (it should work but doesn't -- see below). Use a three-terminal op-amp, right-click to modify properties, choose the default ideal model, the click on "Edit". Find the positive and negative voltage swing items, and change them to +5V and 0V respectively. You now have an op-cmp whose output will saturate at TTL logic levels, which is what you want for a comparator. (The op-amp is ideal, so the the poor behavior of real op-amps when used as comparators does not matter. If you do use the true comparator you will need to add a logic buffer after the output. You’ll also need RC low-pass filter with 20 ohm resistor and 20 pf capacitor between DAC output and comparator input for this device.) ] The "Word generator" can generate an arbitrary timing diagram on up to sixteen lines. Double-click on the word generator to bring up its control panel. Each 4-hex-digit "word" in the list drives the sixteen output lines (four bits per digit), and the generator advances through the list of words at the clock rate that is set in the generator. Eight clock pulses are enough for a conversion, so you can use just the first sixteen words. Set "end" to 000F to stop it at this point. You can use one bit for the clock, one to make the "reset" pulse (so you don't need a switch), and one to make the "start" pulse. (Each hexadecimal digit controls four output lines. If you use the least significant of each group of four bits, you can enter your numbers in binary and don’t have to figure out the hexadecimal combinations.) The logic analyzer clock should be set about 64x word generator clock rate to give good resolution, then set "clocks per division" to about 64 for a reasonable display. (Double-click logic analyzer to open its display, then click on the "set" box under "clock" to set rate.) You can monitor the clock, start and reset pulses as well as the four D flip-flop outputs and the comparator out. Use oscilloscope to look at the comparator inputs (the multimeter does not work for some reason). You can use an adjustable battery as the "Vin" source to measure with your ADC.