Cg101pc Labscope Manual
Cg101pc Labscope Manual
Syscomp Electronic Design Limited http:\\www.syscompdesign.com Revision: 1.01 October 19, 2008
Revision History
Version 1.00 1.01 Date September 2008 October 2008 Notes First revision Added VNA, XY Plot, Spectrum Analysis
Contents
1 Overview 1.1 Oscilloscope . . . . . 1.2 Waveform Generator 1.3 Digital Input-Output 1.4 General . . . . . . . Applications Features and Specications Oscilloscope, Basic Controls 4.1 Amplitude . . . . . . . . 4.2 Timebase . . . . . . . . 4.3 Triggering . . . . . . . . 4.4 Display . . . . . . . . . Additional Features 5.1 Screen Capture . . . . . 5.2 Export to Postscript . . . 5.3 Scope Offset Calibration 5.4 Vector Network Analyser 5.5 XY Mode . . . . . . . . 5.6 Spectrum Display . . . . Aliasing Waveform Generator 7.1 Setting Frequency . . . . . . . 7.2 Setting Sweep Limits . . . . . 7.3 Sweep Mode . . . . . . . . . 7.4 Manual and Automatic Sweep 7.5 Waveform Selection . . . . . . 7.6 Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 3 3 3 4 5 6 6 7 7 8
2 3 4
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
8 . 9 . 9 . 9 . 10 . 11 . 13 16 17 17 17 18 18 18 18 19 19 19 19 20
6 7
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
Digital Input-Output Section 8.1 8 Bit Digital Output . . . . . . . . . . . . 8.2 8 Bit Digital Input . . . . . . . . . . . . . 8.3 Interrupt . . . . . . . . . . . . . . . . . . 8.4 PWM: Pulse Width Modulated Waveform
Safe Measurement Technique 9.1 Floating Power Supply . . . . . . . . . 9.2 Grounded Power Supply . . . . . . . . 9.3 Battery and AC Adaptor Power Supplies 9.4 Russian Roulette and AC Line Voltage . 9.5 Removing the Ground . . . . . . . . . . 9.6 Observation of AC Line Voltages . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
20 20 21 21 21 23 23 23 24 24 24 25 27 28 29 29 30 30 31
10 Overview of USB Operation 11 Troubleshooting 11.1 Microsoft Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1.1 Windows XP . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1.2 Manually Assigning a COM Port Number in Windows XP . . 11.2 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2.1 Manually Changing Device Port Permissions . . . . . . . . . 11.2.2 Setting Default Port Permissions to User Mode: Suse 9.2 . . . 11.2.3 Setting Default Port Permissions to User Mode: Suse 10.3 . . 11.2.4 Setting Default Port Permissions to User Mode: Fedora Core 6 11.2.5 Running the Program . . . . . . . . . . . . . . . . . . . . . . 11.2.6 Device Properties using usbview . . . . . . . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
12 Adjustments 32 12.1 Input Compensation Capacitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 13 Oscilloscope Commands 33 13.1 Using the Debug Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 13.2 CircuitGear ASCII Command Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 14 Manual Operation 39 14.1 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 14.2 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 15 Modifying the Tcl/Tk Software 16 Sources of Information 16.1 News Groups . . . 16.2 Websites . . . . . . 16.3 Paper . . . . . . . 16.4 Textbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 41 41 41 41 41 42 42 44 44 45 45 46 47
17 Windows XP Appendix, Screenshots and Technical Details 17.1 Checking the Installed Files . . . . . . . . . . . . . . . . 17.2 Obtaining Details of the USB-Serial Port . . . . . . . . . 17.3 Adjusting the COM Port Selection . . . . . . . . . . . . 17.4 XP Installation Instructions and Screenshots . . . . . . . 17.4.1 Preliminary: Checking for Installed Drivers . . . 17.4.2 Starting the Installation . . . . . . . . . . . . . . 17.4.3 Continuing the Installation . . . . . . . . . . . .
ii
List of Figures
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 CircuitGear Graphical User Interface (GUI) . . Oscilloscope GUI . . . . . . . . . . . . . . . . Scope Offset Calibration Panel . . . . . . . . . Vector Network Analyser . . . . . . . . . . . . XY Display Mode . . . . . . . . . . . . . . . . Diode Voltage-Current Characteristic . . . . . . Square Wave Spectrum . . . . . . . . . . . . . Generator Controls . . . . . . . . . . . . . . . Noise Waveform . . . . . . . . . . . . . . . . Digital Controls . . . . . . . . . . . . . . . . . Floating Power Supply . . . . . . . . . . . . . Floating Power Supply . . . . . . . . . . . . . AC Line Voltage . . . . . . . . . . . . . . . . Usbview . . . . . . . . . . . . . . . . . . . . . Scope Input Compensation Network . . . . . . My Computer . . . . . . . . . . . . . . . . . . Control Panel . . . . . . . . . . . . . . . . . . Add or Remove Programs . . . . . . . . . . . . System Properties . . . . . . . . . . . . . . . . System Properties, Hardware (Device Manager) Serial Port Properties . . . . . . . . . . . . . . Serial Port Properties, Advanced . . . . . . . . Install Screen . . . . . . . . . . . . . . . . . . My Computer . . . . . . . . . . . . . . . . . . CD Directory . . . . . . . . . . . . . . . . . . Windows Software/Driver Installation . . . . . Windows Software/Driver Installation . . . . . Welcome to the Syscomp .. Setup Wizard . . . Select Destination Location . . . . . . . . . . . Select Additional Tasks . . . . . . . . . . . . . Ready To Install . . . . . . . . . . . . . . . . . Completing the Syscomp .. Setup Wizard . . . Step 2: Install the Drivers . . . . . . . . . . . . Found New Hardware Wizard: 1 . . . . . . . . Found New Hardware Wizard: 2 . . . . . . . . Found New Hardware Wizard: 3 . . . . . . . . Found New Hardware Wizard, Progress Bar . . Found New Hardware Wizard, Final Screen . . Found New Hardware Wizard, Final Screen . . Port Settings Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 6 9 10 12 12 14 17 18 19 20 21 22 32 32 43 43 44 45 46 47 48 49 49 50 50 51 51 52 52 53 54 55 55 56 56 57 57 58 58
iii
Caution: Never connect this instrument to the AC line. Doing so may result in personal injury and extreme damage to the operator, the instrument and to an attached computer. See section 9 on page 20.
1 Overview
The Syscomp CircuitGear CGR-101 is a combination of three electronic instruments: a two-channel digital storage oscilloscope, a waveform generator, and a digital input-output port. Host software can operate the instrument as a spectrum analyser and as a vector-network analyser (Bode plotter). CGR-101 is one of a series of instruments from Syscomp Electronic Design. CircuitGear includes a small hardware module and display software that runs on a host PC. Figure 1 shows the user interface.
1.1 Oscilloscope
The oscilloscope is a dual-channel, 20MSample/sec oscilloscope with 10 bit A/D conversion, digital storage and display. Channels A and B are sampled simultaneously and stored in the oscilloscope memory before being sent for display to the host computer. Consequently, the signals are always time aligned and associated with the same
trigger signal. Triggering is accomplished by digital circuitry so it is precise and consistent. Trigger controls include Mode: Auto, Normal, Single-shot, Manual, Source: A or B, and Slope: Positive or Negative. The trigger point is continuously adjustable so that the operator can display the signal before and/or after the trigger event. The oscilloscope timebase frequency is derived from a crystal oscillator, so it can be expected to be precise and stable. The displayed amplitude is determined by 1% resistors and analog-digital conversion. The vertical preamplier is gain-switched to optimize the signal-noise ratio and will accept x10 scope probes. The initial software release includes basic oscilloscope functions. Subsequent releases1 will include additional features such as spectrum analysis.
1.4 General
The hardware is in a pocket-sized package that can easily be carried in a student backpack or with a laptop computer. Power and control signals are provided to the hardware via a single serial-emulated USB connection with the host PC. The PC host displays a graphical user interface for the oscilloscope with frequency readouts, sliders, clickable buttons and various other controls. The GUI software is written in the Tcl/Tk language. The software is open source and entirely in Tcl/Tk. There are no operating-system specic routines. The GUI software will operate under Linux, Mac or Windows operating systems. Tcl/Tk is an interpreted language, so reading and modifying the source code is straightforward. The applications programming interface (API) is documented, so the hardware can be accessed by other computer programs and languages. The only requirement is that the language be able to communicate with a serial port.
1 Scheduled 2 VNA
2 Applications
In addition to the usual operation of oscilloscope and signal generator, here are some possible applications of the CircuitGear unit. Logic Net The digital controls supply the functionality of a digital Exerciser Unit, which can apply a stimulus to a digital circuit and measure the output. For example the 8 bit digital lines can be used as inputs and indicators for a logic net. Students set up various combinations of input signals to the net and record the outputs to generate logic equations or a truth table for the logic net. State Machine Exerciser A single manual output line and the PWM output can be used as a pulser for counter and state machine circuits. The manual output exercises the circuit at low speeds, where the behaviour can be observed on the GUI indicators. The PWM output is then used to operate the circuit at higher frequencies, and the oscilloscope can be used to observe faster events. Mixed Analog and Digital Circuits The digital outputs control a MDAC (multiplying D-A converter) which sets the centre frequency of a bandpass lter. The generator and oscilloscope function as a Vector Network Analyser, showing how the frequency response changes as the digital value is adjusted. Switching Power Supply The PWM output controls a power MOSFET and LC network which functions as a simple switching power supply. Similarily, PWM output can modulate the power to a DC motor as a simple method of speed control. PWM DAC It is common for the PWM output of a microprocessor to be used as the basis for a low-cost digital-analog converter. The PWM signal is ltered to produce a variable analog control signal. In this exercise students design the PWM lter and then measure the ripple using the CircuitGear oscilloscope. They can also operate the PWM signal at various frequencies to illustrate the effect of frequency on ripple.
Subsequent Release
Waveform Generator Frequency Range Output Amplitude Amplitude Control Vertical Resolution Output Impedance Waveforms Arbitrary Waveform Noise Digital I/O Output Input Pulse waveform Interrupt
8 bits, GUI (Graphical User Interface) controlled, 5 volt, HCMOS 8 bits, GUI indicators, 5 or 3 volt, HCMOS Variable duty cycle at constant frequency 35Hz to 72kHz in steps of x2 5 Selectable level and slope, illuminates Interrupt indicator.
Power LED (Green) Activity LED (Red) USB 2.0: Emulated serial port 3 x 5 Tcl/Tk language Open source, OSI Compliant Windows, Linux, Mac operating systems
Figure 2: Oscilloscope GUI Many of the scope controls are similar in function to those of the classic analog oscilloscope. Other controls are unique to the CGR-101. They provide functions - such as pre-trigger display - that are only possible in a digital oscilloscope. The scope controls divide into various groups: amplitude, timebase, triggering and display.
4.1 Amplitude
There are two input channels, A and B, each with identical controls.
Disable Click on this button to disable display of the corresponding waveform. This is useful to reduce clutter on the display. Scale Sets the vertical scale factor of the display between 50mV per division and 5 volts per division in the traditional oscilloscope 1:2:5 sequence. The amplitude may be read off the display by measuring the number of divisions and multiplying by the scale factor. Alternatively, the display amplitude cursors may be used (see display below.) Changes to the scale control adjust the sensitivity of the front-end .of the oscilloscope, adjust the preamp gain and change the software scale factor.
4.2 Timebase
The Main Time Base (MTB) can be varied between 50nsec/division and 100msec/division in the traditional oscilloscope 1:2:5 sequence.
4.3 Triggering
In order to present a stable waveform display, each display update must start at the same point on a waveform. The trigger functions determine how that trigger point on the waveform is selected. The trigger controls must meet certain requirements in order to generate trigger signals for waveform capture. If these controls are not set properly, it is possible that the scope will not capture waveforms and the display will appear to be frozen. Alternatively, the display may appear to jump between captures, without a stable waveform display. Trigger Time The trigger time is marked by a vertical cursor with an X symbol at the top. The trigger point may be dragged left or right to reveal more or less of the waveform preceeding or following the trigger point. This ability to view the waveform preceeding the trigger point is one of the advantages of a digital oscilloscope. Trigger Level The trigger level is marked by a horizontal cursor with a T symbol at the leftmost edge of the screen. The trigger level may be dragged vertically to set the amplitude on a waveform that establishes the trigger point. In order to cause triggering, the trigger level cursor must be positioned within the amplitude of the triggering waveform. As the trigger is dragged, an accompanying readout displays the trigger amplitude in volts. Trigger Mode: Auto/Normal/Single/High-Res In the Normal position, the scope hardware must get a proper trigger signal in order to display a new waveform. Without a trigger signal, the display simply waits. (The Manual Trigger button can be used to force a trigger event, that is, display one capture.) In the Auto position, if there is a trigger signal, the scope uses the trigger signal to synchronize waveform capture. If there is no trigger signal the scope hardware waits for a period of time and then generates a trigger signal internally. That way, there are periodic updates to the waveform display, even if triggering is not occurring from an input waveform. In general, the most convenient position is Auto. However, there are two situations where Normal triggering is necessary: For very low frequency waveforms, the trigger signals occur infrequently. If Auto triggering is enabled, the scope will decide that trigger signals are not present and generate them internally. This is not what is wanted: the scope should wait for a waveform trigger signal. 7
If the scope is being used to capture a single-shot event, then it should not trigger itself: it should wait for a waveform trigger signal, regardless of how long it takes for that trigger signal to occur. In the Single position, the scope waits for a trigger signal. (This is known as the Armed state.) When a trigger signal occurs, the software captures and displays that waveform and disables further triggers. The Single-Shot Reset button clears the display and returns the scope to the Armed state. Trigger Slope The trigger slope control selects a positive-going or negative-going slope at the trigger point. This allows one to trigger off the leading or trailing edge of a positive pulse waveform, for example. Trigger Source The trigger signal may be derived from the Channel A waveform or the Channel B waveform. Generally, it is easier to obtain a stable trigger signal from the simpler of the two waveforms. Manual Trigger Actuating this button generates a trigger signal. This is sometimes useful to cause the scope to capture one waveform. Trigger Level (Readout) This display shows the amplitude of the trigger level setting. Display Lag For low frequency waveforms displayed at slow timebase settings, there is a noticeable lag between display updates. This occurs because each display is shipped back to the host as a complete waveform and it takes time for the 1k memory to ll with data.
4.4 Display
Refer to gure 2 on page 6. Vertical Position A waveform may be moved in vertical position. At startup, the A and B cursors - which are the zero reference for the channel are placed at centre screen. Using the mouse, drag the letter A or B at the right edge of the display area up or down to change the vertical position of the corresponding waveform. Time Cursors It is possible to enable and disable various time and amplitude cursors. Right click in the display area. A menu appears: Toggle Time Cursors Toggle Channel A (or B) Cursors Grid Auto Measure Left Click to enable and disable vertical cursor lines that mark the time between two locations on screen. Left Click to enable and disable horizontal cursor lines that mark the amplitude between two locations on screen. Left Click to select the appearance of the graticule grid in the display area. Follow the menu heirarchy to select auto-measurement of average amplitude and/or frequency on Channel A or B
Notice that the readout text can be dragged to different positions on the screen. This is useful when setting up a screen display for capture in a document.
5 Additional Features
Section 4 described the basic controls of the oscilloscope. In this section we describe additional controls for more specialized measurements. 8
Special thanks to John Foster who helped develop the screen capture code.
Offset values appear in the Value windows. The traces should be near the zero position on screen. Click on Save Calibration Values to Device. This transfers the offset values to the EEPROM of the CircuitGear unit, thereby ensuring that the offsets are associated with that hardware if multiple CGR units are used on the same host. Close the Offset Calibration display window.
Figure 4: Vector Network Analyser An electrical network, such as a lowpass lter, is characterized by its amplitude and phase response. The amplitude response is a plot against frequency of the gain of the network: the ratio of output signal amplitude to input signal amplitude. The phase response is a plot of the phase of the network: the difference between the output phase and input phase. The test signal is a sine wave that is swept over a range of frequencies, taking care not to overload the network. As part of their AC Circuits lab, electrical engineering students are required to plot these response curves by hand. This is a very tedious process. Each point in the plot requires setting the generator frequency, reading the input signal amplitude, reading the output signal amplitude, reading the output signal phase, and plotting the result. The CGR-101 vector network analyser does this automatically over a range of 1Hz to 1MHz, or some part thereof. This makes it practical to explore the effect of changing component values. For example, if the resistor
10
or capacitor value in an RC lowpass lter is changed, one can immediately determine the effect on frequency and phase response. The CGR-101 has two principal modes: as an oscilloscope and signal generator (with digital input-output), and as a network analyser. To change between them, select Hardware -> Network Analyser Mode or Hardware -> Circuit Gear Mode. Figure 4 shows a screen shot of a VNA plot of a single-pole RC lowpass lter. Two slide controls set the start and nish frequency A third slider sets the signal amplitude. The Oscilloscope Display window shows the input and output waveforms, which should be sine waves. If the signals show clipping, reduce the signal amplitude. The Start button initiates a frequency sweep. Sweeping is slow at low frequencies and speeds up as the frequency increases. You can change some network parameter and then rerun the sweep. The display will then show the new trace with the old. Erase the display with the button at View -> Clear Bode Plots. The amplitude dynamic range of the VNA is in excess of 50db. The VNA automatically adjusts the input signal attenuators of the oscilloscope section to obtain the best possible signal-noise ratio without clipping. It also uses the full 10 bit range of the oscilloscope A/D converters. In the frequency response plot of gure 4, the amplitude and phase plots become erratic at high frequencies. This occurs because the output signal from the low pass lter is extremely small in that region. More information on the operation and theory of the vector network analyser is in the Syscomp Application Note A Software-Based Network Analyser at http://www.syscompdesign.com/na-theory.pdf.
5.5 XY Mode
The usual oscilloscope display shows a plot of the two signal signal amplitudes, voltage on Channel A and Channel B, vs time. It is also possible to plot the two voltages against each other: Channel A as the X axis and channel B as the Y axis. Select View -> XY Mode to enable the XY display. The CGR-101 can simultaneously display both the XY display and the conventional voltage-time waveforms, which is useful in teaching situations and for debugging purposes. Lissajous Figures When the two signals are sine waves of the same frequency, with a phase shift between them, the display is as shown in gure 5. This type of looping display is known as a lissajous gure. If the two frequencies different but integer multiples of each other, then the lissajous gure will have multiple nodes. In the early days of oscilloscopes, lissajous gures were used in this manner for frequency measurement. The vertical ampliers of the day could not work at high frequencies, so the signals were applied directly to the deection plates of the cathode ray tube. The lissajous gure gave an indication of frequency ratio and relative phase. To form a complete lissajous loop, the timebase setting must be such that both waveforms show at least one complete cycle. 11
Figure 5: XY Display Mode Magnitude Measurement If the two signals are exactly in phase, the XY plot is a straight line. If the two signals are of exactly the same magnitude, the angle of the straight line is 45 . If the magnitudes are different, then the line is at some other angle. This is a sensitive method of comparing the amplitude of two waveforms, which need not be sine waves. Any waveshape should function in this measurement. General Purpose Plotting The XY Mode display may be used for a variety of applications where a plot of some kind is required.
12
Figure 6 shows an example. The CGR-101 has been congured to plot the voltage-current curve of a silicon diode. Notice that the diode threshold is around 0.6 volts. The vertical scale is voltage measured across a current sensing resistance, equivalent to 10mA per division.
of the square wave extend to much higher frequencies but we assume their amplitude is small enough to be ignored. FFT routine requires that the number of points be a power of 2.
13
Figure 7: Square Wave Spectrum As the readout cursor is dragged higher in frequency it jumps from bin to bin, reading out the centre frequency of each bin. A given frequency component may not be centred in its bin, so the frequency readout will be only approximate. For example, in gure 7, the square wave frequency (generated by a Syscomp WGM-101 waveform generator) is at a frequency 10kHz to within a fraction of a Hz. The 9th harmonic is at 90kHz. The spectrum display readout puts the 9th harmonic at 90234 Hz, which is only approximately correct.
14
Frequency Scale, Bin Spacing It is sometimes useful to be able to determine the resolution of the frequency axis. Each frequency bin has a width f = 1/T Hz where T is the length of the data record in seconds. If there are N points in the data record, then N/2 points are displayed as positive frequency. (The other N/2 points are redundant.) Example Determine the frequency resolution (bin spacing) for the case of the display of gure 7. Solution The sample rate is 200kS/sec. The sample interval T is the reciprocal of this: 1 200 103 5 Sec
= =
The number of points N in the data record is 512 points, so the total length of the data record is: T = = N T 2.56 mSec
= =
For example, the 7th harmonic should appear at f7 = 70kHz. The spectrum display actually puts it at 70313 Hz, which is bin 180. F7 = = 180 390.625 70313 Hz
The maximum frequency fmax on the display occurs at bin 256: fmax = = Windows Window or weighting functions are often applied to the time-sequence data prior to transformation into the frequency domain. All window functions taper the data down to zero at its ends. Then the discontinuity caused by a nite record length does not affect the shape of the transform. 256 390.625 100 kHz
15
The choice of window function depends on the application, and all window functions are a compromise of some sort. For example, some window functions provide very accurate amplitude readings, others are best for separating closely spaced frequencies. A collection of window functions is shown at http://en.wikipedia.org/wiki/Window_function. The current spectrum analysis routines have only one window function, the rectangular window. This is in fact a non-window, it does not shape the time function, all points on the time record are weighted equally. Other weighting functions may be added in future versions of the software. Applications Spectrum analysis has a number of applications in electronics and mechanical engineering: A pure tone has no harmonics and will show up on a spectrum display as one single vertical line. Distortion of a sine wave will create additional harmonics. Consequently, a measure of the magnitude of the harmonics is a measure of the magnitude of the harmonic distortion. In a distortion-free (linear) system, two separate input tones (single frequencies) will emerge as the same two tones at the output. If the system is distorting (non-linear), then the system will generate other tones at the sum and difference frequencies of the input signals. A measure of these extra signals is a measure of the intermodulation distortion. The existence of certain frequencies in a signal may give some clues as to its source. For example, if a signal contains the power line frequency (eg, 60Hz in North America, 50Hz for the UK), then it is probably picking up interference from the AC power line. Power systems frequently manipulate waveforms by chopping them or combining them with other signals. Spectrum analysis allows one to measure the harmonic content of a signal, which may be specied as a requirement. The analysis of a mechanical system for resonances can be done by driving the system with a wide-band excitation signal, an impulse hammer blow or random noise from a shaker. Microphones or accelerometers convert the mechanical vibration of the system to an electrical signal. The spectrum analysis of this signal indicates the mechanical resonances in the structure. The extraction of signals from noise may require some knowledge of the spectrum of the signal and the noise. It is useful to see the spectrum diagram for modulation and other signal manipulations. Further information on spectrum analysis is in the paper Introduction to Digital Spectrum Analysis, which is on the Syscomp web site.
6 Aliasing
The oscilloscope is a sampled-data-system. It works by taking a series of samples of the input waveform and displaying them. However, when the signal contains high frequency components compared to the sampling rate, the display may be incorrect. In theory, at least two samples per cycle of the highest frequency present in the waveform are required to reconstruct the waveform correctly.
16
Some sampled-data-systems have a constant sampling rate. For example, audio is typically sampled at 44.1k samples per second. In that situation, usual practice is to incorporate a low-pass lter such that frequencies above 22 kHz are prevented from entering the system6 Most if not all digital oscilloscopes do not incorporate an anti-aliasing lter. The sample rate of a digital scope varies over a wide range of frequencies, and so the cutoff frequency of the anti-aliasing lter would have to do so as well. Combined with the bandwidth requirement, that is a difcult technical challenge. Instead, the oscilloscope relies on the operator to recognize when aliasing is occurring and increase the sample rate until the effect disappears. A useful strategy in measuring an unknown waveform is to approach it from a high sampling rate (aka timebase setting) and reduce the setting until a readable display appears. It is also required of the operator to know (approximately) the frequency of the waveform that is being observed. That is often the case. A useful rule of thumb is this: the display must contain about 10 samples per cycle of the waveform to reconstruct it. For this oscilloscope the maximum sampling rate is 20MSamples/second, so it can usefully observe frequencies up to about 2MHz. The analog bandwidth has been designed to be 2MHz to meet this requirement.
7 Waveform Generator
The waveform generator controls are shown in gure 8. The Amplitude control is calibrated from 0 to 100%.
practice, the lowpass cutoff frequency is set to somewhat less than half the sampling frequency to allow for the nite rolloff rate of the
lter.
17
As another example if you are investigating the frequency response of a 3kHz narrow-band active lter, you could set the frequency range to 3050Hz maximum and 2950Hz minimum. Then the adjustment range of the generator is 100Hz, giving effective ne-grain control of frequency.
7.6 Noise
CircuitGear can generate a random noise signal (gure 9), which is useful in transfer function measurents by correlation and acoustical testing. The output spectrum is white, that is, equal energy per hertz bandwidth 7 .
acoustical testing, you will probably need a pink noise spectrum, which rolls off the amplitude at 3db/octave, a 1/f characteristic. See the Book References, page 41 for a passive pink-noise lter circuit. It is also adviseable to limit the spectrum to the audio range to avoid damage to ampliers and tweeter loudspeakers.
7 For
18
The noise is generated by a 32-bit shift register, congured to give a pseudo-random bit sequence, and clocked at 100MHz. (See http://en.wikipedia.org/wiki/Linear_feedback_shift_register.) Every 8 shift pulses, an 8 bit sample is extracted and converted to analog form. Consequently the noise rate is 12.5Msamples/second. The shift register sequence length is 232 1 shifts before repeating, which gives a repetition period of 42 seconds. The amplitude spectrum is actually a sin(x)/x function, but for practical purposes the spectrum is at to 2MHz.
Figure 10: Digital Controls The CircuitGear digital controls are shown in gure 10. These input and output lines can be operated from the GUI controls in gure 10 or they may be controlled by software that communicates with the CircuitGear API (applications program interface, section 13.2 on page 34).
8.3 Interrupt
The interrupt is a 3V or 5V HC compatable logic input. A dropdown menu below the interrupt indicator/button establishes the mode of operation, one of Disabled, Rising Edge, Falling Edge, High Level, Low Level. When the specied type of interrupt occurs, the ! indicator illuminates. Left-click on the indicator to clear the interrupt.
19
Figure 11: Floating Power Supply In this context, oating power supply is one in which neither terminal is connected to the power line ground. Consider the circuit shown in gure 11. Like many lab power supplies, the power supply has three terminals: positive, negative and ground. The ground terminal is connected to the third prong on the line cord, which connects to the power line ground wire. The oscilloscope has two connections: the input terminal and ground terminal. On the front panel BNC connector, the inner contact is the input, the outer ring is ground. The ground connector nds its way to the AC ground line via the third prong on its line cord. As shown in gure 11, either lead on the oscilloscope can be safely connected to the positive or negative terminal of the power supply. With proper care to avoid short-circuits of the power supply, this is a safe measurement situation. 20
Black
Ground
Ground Green
Ground Strap
Figure 12: Floating Power Supply Now consider that the negative terminal of the power supply is connected to its Ground terminal, as shown in gure 12. If the ground terminal of the oscilloscope is connected to the ground terminal of the power supply, then the circuit is in no danger and will work properly. However, if the ground terminal of the oscilloscope is inadvertently connected to the positive terminal of the power supply, then the power supply will be connected to a short circuit. The power supply short circuit will drive current around the ground connections of the power supply and oscilloscope. Since lab power supplies are usually current limited to less than an ampere of current, the equipment will likely survive. However, the circuit will not function properly because the power supply is in a short-circuited condition. To avoid this situation, do not connect the positive or negative terminal of the lab power supply to the ground terminal. Leave the supply oating.
21
Ground
Neutral
To earth
Figure 13: AC Line Voltage and ground are connected together and to an earth ground at the system AC distribution panel. The hot and neutral line carry load current in the system normally the ground wire does not carry any current. Because the neutral is carrying current and because the neutral wire has resistance, at any given point in the system there likely will be a small voltage difference between the neutral and ground wires. If the ground wire of the oscilloscope is inadvertently connected to the hot wire of the AC line, an extremely large short circuit current will ow through the ground connection. Eventually, a circuit breaker will open, a fuse will blow, or the short-circuit current will destroy a conductor. However, until that occurs, the short circuit current can be in the order of hundreds of amperes. This current will destroy the oscilloscope and computer, and the resultant aming debris may cause injury to nearby living organisms, including humans. It may also start a re. Furthermore, connecting the ground lead of the oscilloscope to the AC neutral line causes another problem it effectively connects the neutral and ground AC lines at that point. Now the neutral current has another path, and some of it will ow through the oscilloscope and computer ground leads. If this current is sufcient, it may damage the oscilloscope and computer. Notice that this same situation can occur with equipment that is not transformer isolated from the AC line. For example, some electronic equipment has a direct connection to the AC line, so that the chassis is connected directly to the neutral line of the AC system. To safely observe the signals in this device with an oscilloscope the equipment must be isolated from the AC line by a transformer. The transformer must function as an isolation transformer, the secondary winding must not have an electrical connection to either of the primary leads, and the transformer must consist of a separate primary and secondary winding. An autotransformer (common trade name Variac) is an adjustable transformer that is often used for adjusting line voltage. An auto transformer does not have an independent secondary winding and cannot be used to isolate electronic equipment from the AC line.
22
over the USB cable so that an AC adaptor is not needed. Third, the USB system handles enumeration automatically so that multiple devices are accessed correctly without manual conguration. Under Windows, the FTDI USB-serial drivers are automatically loaded by the Install program, so the user should not normally be required to intervene. Under Linux, the FTDI drivers are included in the Linux kernel since 2.4, so they do not need to be installed under Linux. When a USB-serial device is plugged into the host computer for the rst time, the host USB system detects a new device and allocates it to a serial port. In Windows, this is a COM port. In Linux, this is a device such as /dev/ttyUSB0. Thereafter, the operating system always associates that hardware with that serial port, even if it is plugged into a different USB port. In Linux, the default permission of the /dev/ttyUSBx ports is set for root access only, so the permissions must be changed as described under 11.2. (The x in /dev/ttyUSBx represents a number for a ttyUSB port, something like ttyUSB0 or ttyUSB1, and so on.)
11 Troubleshooting
In addition to the information provided here, you may also nd useful information and screenshots in sections 17.1, 17.2 and 17.3.
24
7. Start the oscilloscope Tcl program by double clicking on its icon. The exact name will vary, but it should be something like scope-100.tcl. It may complain with an Unable to Connect warning message. Ignore this and close the warning message. The oscilloscope GUI should now be on the screen. 8. On the oscilloscope GUI, open Hardware -> Connect. Select the COM port that you found previously. In our example, that would be COM 5. Click on Save and Exit. This causes a small text le scopeport.cfg to be written to the directory where the scope program was launched. Thereafter, the oscilloscope GUI Tcl program will read this le and automatically select that particular COM port. 9. Open Hardware again and click on Connect. The oscilloscope GUI status message at the top of the screen should show Connected. This is a Happy Moment, because your computer is now talking properly to the oscilloscope hardware. 10. Operate the frequency, amplitude or offset controls on the oscilloscope GUI. As you do so, the GUI sends commands to the hardware and you should see ashing from the Activity LED on the hardware front panel. From now on, it should be sufcient to boot up your computer, plug in the oscilloscope and double-click on the desktop icon for the oscilloscope. 11.1.2 Manually Assigning a COM Port Number in Windows XP It may be useful to know how to set the COM port manually. For example, under certain circumstances, it is possible for the operating system to assign a COM port number that too high to be usable by the host software. In our situation here at the Syscomp factory, we test each instrument by plugging it into a USB port. Each time the operating system sees a new instrument, it assigns it a new COM port number. If the COM port number is greater than 9, it cannot be selected by the host software. Then you must re-assign the port number manually. 1. Plug in the problem instrument to a USB port. 2. Go to: Start -> Settings -> Control Panel -> System -> Hardware -> Device Manager 3. Double-click on Ports (COM and LPT). This opens to show any USB-serial port assignments. Lets say that it shows USB Serial Port (COM12). This exceeds COM9, so we have to manually reset the COM port number. 4. Double-click on the entry USB Serial Port (COM12). This opens a new dialogue box, USB Serial Port (COM12) Properties. 5. Select Port Settings and click on Advanced. 6. This opens a new dialog box, Advanced Settings for COM12. In the upper left corner, there is a scrollbox COM Port Number. Use the up/down arrows to scroll through the possible COM port assignments. 7. For the new COM port assignment, its best to choose a COM port number 4 or larger. (Lower numbers may conict with a USB keyboard or mouse). Suppose we decide to move to COM5. The scrollbox says COM5 (in use). Select it anyway. Click OK. 8. A warning pops up that the COM port is in use and asks if you want to continue. Click on Yes.
25
9. Back out through the menues until you have closed the Device Manager panel. Re-open it and examine the Ports (COM&LPT). This time it should read COM5. 10. Back out to a clean desktop and restart the instrument program. This time, it should connect properly. 11. If you are connecting multiple instruments, you may need to do this for each instrument. However, having once done the assignment for a given instrument, the operating system associates that instrument with the chosen COM port and connection should be automatic.
26
11.2 Linux
These troubleshooting notes are specic to Suse Linux 9.2, but should apply in general. They also assume a working knowledge of Linux and its variants. Overview If the software does not operate correctly, here are some things to check. They are subsequently explained in detail. The operating system is too old and does not contain the necessary drivers for the usb-serial ports. The operating system for some reason is not recognizing the usb device and assigning it to a usb-serial port. This can occur if the usb device has root ownership and permissions. The permissions must be changed to allow a user-mode program to access the usb port. The operating system is assigning the hardware to some usb-serial port but the Tcl/Tk program is not automatically selecting that particular port. Youll need to select the usb-serial port manually, using the controls in the Tcl/Tk program. The wish program, which is the interpreter for all Tcl/Tk programs, is not being found by the operating system. Locate it and change your path so that it is found. The device is being recognized and connects properly, but does not respond properly to certain controls. Use the instructions in section 14.2 to send commands to the hardware to determine how it is functioning. 1. Check the kernel version. The drivers for the FTDI USB-Serial interface are a standard part of the Linux kernel from version 2.4 onward. To check that you have a sufciently modern kernel, run the dmesg command piped to the more command. phiscock@panther: dmesg | more Examine the rst few lines, which should be something like this: Linux version 2.6.8-24-default (geeko@buildhost) (gcc version 3.3.4 (pre 3.3.5 20040809)) #1 Wed Oct 6 09:16:23 UTC 2004 In this case, the kernel is 2.6.8-24, so it contains the FTDI drivers. If your kernel version is older than this, you may have to upgrade the kernel or install a driver module. 2. Install the software: per the instructions on the CDROM. 3. Determine the serial port used by the USB driver. In this step, well use the dmesg command to determine which serial (COM) port is being assigned to the oscilloscope when it is plugged in. Execute dmesg to get an idea of the most recent kernel messages. Using the USB cable, connect the scope hardware to a USB port. Execute dmesg again, and you should see something like this as the last entry in the dmesg printout:
27
usb 4-2: usb 4-2: usb 4-2: usb 4-2: ftdi_sio usb 4-2:
new full speed USB device using address 4 Product: USB <-> Serial Cable Manufacturer: FTDI SerialNumber: 00000001 4-2:1.0: FTDI FT232BM Compatible converter detected FTDI FT232BM Compatible converter now attached to ttyUSB0
Unplug the USB cable and run dmesg again and see something like this: usb 4-2: USB disconnect, address 4 FTDI FT232BM Compatible ttyUSB0: FTDI FT232BM Compatible converter now disconnected from ttyUSB0 ftdi_sio 4-2:1.0: device disconnected Evidently the USB device is being assigned to device ttyUSB0. This shows that the USB device is being recognized by the operating system and assigned to a usb-serial port. 4. Set the permissions for the USB-Serial port The default situation is that root is the owner of the USB serial port ttyUSB0 and operation is restricted to root. For an ordinary user to access the port, the permissions must be changed. First, we will show how to do this manually in section 11.2.1. However, Linux is usually set up so that the permissions revert back to root mode every time the USB is plugged and unplugged, and every time the system is rebooted. Therefore, we need to modify the system so that this is done automatically, ie, so that the port permissions are set to user mode by default. This is shown in section 11.2.2 below. 11.2.1 Manually Changing Device Port Permissions Change to the /dev directory. phiscock@linux:> cd /dev Check the permissions on the ttyUSB ports: phiscock@linux:/dev> ls -l ttyUSB* crw-rw---- 1 root uucp 188, 0 2005-11-07 18:25 ttyUSB0 crw-rw---- 1 root uucp 188, 1 2004-10-02 01:38 ttyUSB1 <others deleted> In this case, the owner (root) has read-write access. The group that root belongs to, uucp, also has read-write access. Others (thats you) have no access at all. To open up the port to user access, enter root mode using the su command: phiscock@linux:/dev> su The system asks for the root password. Enter it. Now you can change the permissions (mode) for the ports. In this case, well use the chmod command to add read and write permission for others. For example, the rst command below says: change the mode of device ttyUSB0 to add read permission for others. The second command does the same for write permission. 28
linux:/dev # chmod o+r ttyUSB0 linux:/dev # chmod o+w ttyUSB0 Check the permissions again: ls -l ttyUSB* crw-rw-rw- 1 root uucp 188, 0 2005-11-07 18:25 ttyUSB0 crw-rw-rw- 1 root uucp 188, 1 2004-10-02 01:38 ttyUSB1 Thats it. You should now be able to access those ports from user mode. Exit from root to user mode. Incidentally, you may be able to change the permissions by logging in as root and then using the features of the KDE or Gnome desktop to change the permissions. 11.2.2 Setting Default Port Permissions to User Mode: Suse 9.2 This change will ensure that the serial-usb ports are always created with user mode access. The default permissions for user devices are contained the le: /etc/udev/permissions.d/50-udev.permissions . We have to modify the entry for the ttyUSBx ports so that the default is user mode. 1. Change to the directory /etc/udev/permissions.d and check that the le 50-udev.permissions exists. 2. If the le exists, 9 enter root mode, and copy the existing le so you have a copy of the original. cp 50-udev.permissions 50-udev.permissions-orig 3. Now open the le 50-udev.permissions with your favourite editor. Find the entry that says: ttyUSB*:root:uucp:660 Change that to read: ttyUSB*:root:uucp:666 Save the le. Now every time a ttyUSBx port is created, you should be able to access that port without problems. 11.2.3 Setting Default Port Permissions to User Mode: Suse 10.3 Suse in their wisdom have changed the method detecting USB devices. Now, USB devices do not exist in /dev until they are plugged in. Plug in the DSO-101 oscilloscope and execute dmesg. You should see something like the following at the end of the message: usb usb usb usb usb
9 If
new full speed USB device using uhci_hcd and address 2 new device found, idVendor=0403, idProduct=6001 new device strings: Mfr=1, Product=2, SerialNumber=3 Product: Digital Oscilloscope DSO-101 Manufacturer: Syscomp
the le does not exist, please let us know the name of the Linux distribution and well look for another solution.
29
usb 1-2: SerialNumber: DSQ3Q7ZO usb 1-2: configuration #1 chosen from 1 choice drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected drivers/usb/serial/ftdi_sio.c: Detected FT232BM usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0 usbcore: registered new interface driver ftdi_sio drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver This indicates that the oscilloscope was detected and it has been assigned to the USB-Serial port ttyUSB0. You now go to the director /dev and examine the ttyUSB0 entry: phiscock@panther:/dev> ls -l ttyUSB0 crw-rw---- 1 root uucp 188, 0 2008-04-20 12:57 ttyUSB0 The uucp group have read-write permission to this device, so the permanent solution is to add uucp as one of your groups. In Suse 10.3 this is done from: Computer -> Control Center -> Open Administrator Settings. Youll need to enter the root password. Then go to: Security and Users -> User Management -> User and Group Administration. Select the user (thats you) and click on Edit. This brings up the Existing Local User page. Click on Details. Under Groups check off uucp. Log out and log back in, or restart the computer. You should now be able to access the USB port without having to change its permissions. 11.2.4 Setting Default Port Permissions to User Mode: Fedora Core 6 This note10 applies to Fedora Core 6, kernel 2.6.19-1.2911.fc6. Look in /etc/udev/rules.d/50-udev.rules for the line: KERNEL=="tty[A-Z]*", NAME="%k", GROUP="uucp", MODE="0660" Change the mode value to 0666. 11.2.5 Running the Program 1. Change to the directory where the program resides. The wish interpreter is required to run the tcl program. It is normally included with a Linux distribution, so it is probably present on your system. You can nd out by issuing the which command. phiscock@linux: which wish /usr/bin/wish If this doesnt turn it up, use the nd command, starting at the root directory /. If it is on the system, then add that location to your path. phiscock@linux: find . -name wish <much deleted> /usr/bin/wish
10 Kindly
30
2. Start wish. phiscock@linux:/eelab/demos> wish 3. A new small window will appear. This is the container for any program that wish executes. The cursor remains where the wish command was run. 4. Click in that window and run the command: % source main.tcl using the correct name for the oscilloscope program. The oscilloscope GUI should now run correctly. There are many other ways to start the program. For example, the command wish scope-101.tcl (substitute the correct name of the tcl program) can be used. As well, the KDE and Gnome graphical user interfaces be used to set up an icon on the desktop. Then clicking on that icon will start the program. 11.2.6 Device Properties using usbview In general, its not necessary to know anything about the USB properties of the hardware in order to use it. However, if you do want to inspect those properties, usbview is useful. It is likely that you will have to install usbview from your Linux distribution disks. Once usbview is installed, (gure 14) you can use it to determine whether a USB device is recognized by the operating system USB. As a USB device is plugged and unplugged, an entry appears and disappears in the usbview window. Clicking on an entry opens up a list of USB properties of the device. Notice that usbview does not indicate the serial port (/dev/ttyUSB2 or whatever) that the operating system has assigned to this device. You must use dmesg for that purpose.
31
12 Adjustments
The oscilloscope has been adjusted before shipping, so it should not need adjustment before use. These instructions are provide for reference purposes.
r
Input
.... ..... .. ...... . ..... . .. .. . .... .. . . ... ..... ... .. .. .. ... .. .. .. . . . .. .. ... .... .. . ... .... .... .... .. .. . .. ... ... .. ... .. .... ...... .. ...... ... .
VC1
.. .. . .. .. ..
D1
U3A
. 3 + ................... .... .... 1 .... .... . .. 2 .... .... .... .... ............... . . . .... .... .... .... .... .... .... ....
r
... .... . .. . . .. .... .... ... .. .. ..
r
.... ...... .. ... ...
r
C1
.. ... . .. .. .
J1
D2
r
.. .. ... .. .. . .... ..
-2.5V
.. .. .... .
32
The two channels are identical. Stray capacitance at the output of the voltage divider has the potential for limiting the bandwidth. To make the divider frequency independent, the resistive divider R1, R2 is accompanied by a capacitive voltage divider VC1, C1. The capacitive divider must be adjusted to have the same division ratio as the resistors. This is accomplished by adjusting VC1. To do so, remove the circuit-board from its plastic case. Connect it to the computer via its USB cable and start the host software. Apply a square wave input signal to one of the scope channels. Adjust the magnitude of the square wave such that it makes a suitable display. Adjust the oscilloscope timebase such that the leading edge of the square wave is visible. The two variable capacitors are relatively large, square components that rise above the other components on the board. (The current versions have orange casings.) On the current design they are designated C61 for Channel A and C81 for Channel B. Locate the variable capacitor on the circuit that corresponds to the input channel with the signal. With a tiny screwdriver, adjust that variable capacitor until the square wave shows the fastest possible rise time without overshoot. It is best to use a screwdriver with an insulated shaft because a non-insulated screwdriver will connect human body capacitance into the circuit which affects its operation. If the screwdriver is not insulated, make an adjustment and then remove the screwdriver to see the effect. Repeat the same procedure with the second oscilloscope channel. Reassemble the unit back in its case. If you are using a x10 oscilloscope probe, the input capacitance of the scope channels will have changed slightly. You will need to adjust a x10 probe for best square wave response. If the probe is a x1 x10 switchable unit, ensure that the probe is switched to the x10 position. Attach it to one of the channels. Connect the probe to a square wave source, such as the CGR-101 generator output. Find the compensation adjustment screw on the scope probe. In the economy probes we sell, the screw adjust is red and located in the base of the probe cable, near the BNC connector. In the professional probe we sell, the screw adjust is yellow and located in the probe, near the handle. Adjust this screw for best square wave response.
13 Oscilloscope Commands
These commands are low-level instructions to the scope hardware. The commands (and where relevant, messages back from the hardware) are ASCII strings so that they can be generated easily by software or a human operator. There are two situations where the interface commands may be useful. The scope hardware may be operated directly from a terminal emulator program such as Hyperterminal under Windows, Minicom or Seyon under Linux. The commands must be known to create a scope control program with different functionality. For example, a program could be created to sweep the read the oscilloscope and plot the results on a strip-chart type of display. This new program needs to issue commands to the hardware. Should you decide to attempt such a project, the Tcl source code for the Oscilloscope GUI, which is provided on the accompanying CDROM, will be a useful source of ideas in controlling the scope. There is no requirement that the controlling program be written in the Tcl language. Any program that can issue ASCII strings to a serial port will be capable of controlling the scople hardware. (i.e Matlab, Visual Basic)
scope would slow down the overall operation of the system. Each command consists of an ascii string of characters, such as T55<cr> to set the trigger level to 55, where <cr> is a carriage return character. In addition to the material in the user manual, you can see commands being sent to the oscilloscope by selecting View -> Debug Console. This brings up a terminal screen which lists commands as they are being sent to the scope hardware, and some other debug information. This information scrolls past rather quickly when the scope is in auto trigger mode, because it is repeatedly obtaining data from the hardware. To slow this down, put the scope in Manual Trigger mode. Now each time you hit the manual trigger button, the debug screen will show the commands that were sent to the scope hardware. Now you can change control settings on the scope GUI and see the corresponding commands as they are sent to the scope hardware. For example, move the trigger level cursor on the scope screen and you will see a series of trigger level commands like T55 T43 T27 being sent to the hardware. Similarily, changing the vertical preamplier gain settings to show the corresponding hardware commands.
34
The parameter ADDR is an 8-bit integer (0-255) representing the sample number. The parameter DATA is an 8-bit integer (0-255) representing the waveform amplitude of the sample at address ADDR. The data is stored in a waveform buffer in the generator handware. Command Description WP Waveform: Program waveform. This command takes all of the data stored in the waveform buffer (previously set up using the W S command) and programs it into the FPGA, changing the output waveform. Command Description S T T_HIGH T_LOW Scope: Adjust trigger level. T_HIGH and T_LOW represent a 10-bit number (0-1023). The trigger voltage is calculated as follows: Trigger Value = 511 Gain (Trigger Voltage)/(0.052421484375) Where Gain=1 for the 5V scale and Gain=10 for the 500mV scale. Example: Setting the trigger level to 1V on the 5V scale: Trigger Value=511-(1)*(1.0V)/( 0.052421484375V)=492 The command would be S T 1 236 Command Description S C C_HIGH C_LOW Scope: Post trigger sample count. The 8-bit numbers (0-255) make up a 10-bit number representing the number of samples that will be captured after a trigger event. For example, the command S C 1 20 represents a post-trigger count of 276, so 748 samples will be captured before the trigger event, and 276 samples will be captured after. This command can be used to examine events before and after the trigger of a given capture.
35
Command Description S R REG_VALUE Scope: Update the control register REG_VALUE Bits Function 3:0 Sample rate select. The sample rate is determined by the following formula: Sample rate = 20MS/s / (2N ) Where N is the 4-bit number (0-15) made up of bits 3 down to 0 in the scope control register 4 Trigger Source, 0: Channel A, 1: Channel B 5 Trigger Polarity, 0: Rising, 1: Falling 6 Internal or External Trigger, 0: Channel A or B as dened by bit 4 1: External Command Description S D DEBUG_CODE Scope: Debug hardware command Debug Code Function 0 Set RESET=0 1 Set RESET=1 2 Set REQ=0 3 Set REQ=1 4 Set MAN_TRIG=0 5 Set MAN_TRIG=1 Command Description S G Scope: Go, begin capture. The scope will reply with a message when the capture is complete. The message is three bytes long. The rst byte is the A character indicating that the scope is returning the address where the capture ended in the scopes circular sample buffer. The second and third bytes are in binary format and form a 1-bit number representing the ending address. The trigger point can be derived by subtracting the post-trigger sample count. Command Description SB Scope: Read scope data buffer. Scope will return the entire scope memory preceded by the D character. The data is in binary format with the following organization: A1a1B1b2A2a2B2b2.... Where A1 is the upper byte and a1 is the lower byte of a 10 bit sample. There is no termination character at the end of the buffer. The user should expect to receive 4097 bytes (4096 bytes for samples, plus one byte for the D character at the beginning of the transfer.)
36
Command Description SS Scope: Query scope state machine Returns the scope state in the following format: I State: X Where X is the current state of the state machine. Command S P [AaBb] A a B b Description Scope: Preamp settings Set preamp A to 1/2/5V range Set preamp A to 500mV/200mV/100mV/50mV range Set preamp A to 1/2/5V range Set preamp A to 500mV/200mV/100mV/50mV range
Command Description SO Scope: Read offset calibration Returns the offset values stored in eeprom in the form OAaBb where A, a, B, b are 8 bit signed numbers corresponding to the offset for each channel and range setting. Command Description S F A a B b Scope: Store offset calibration into eeprom Allows the user to store 4 8-bit numbers into the device eeprom for offset calibration. Refer to the GUI for an example. Command Description DON Digital: Set digital output byte to N The parameter N is an 8-bit integer (0-255). E.g. The command D O 3 would set bits 0 and 1 of the output port.
37
Command Description DI Digital: Read digital inputs. Returns an 8-bit value corresponding to the input byte. Command DFN N 0 1 2 3 4 5 6 7 8 9 10-255 Command DDN Description Digital: Set PWM frequency Frequency 72 kHz 36 kHz 9 kHz 4.5 kHz 1.125 kHz 564 Hz 281 Hz 141 Hz 70 Hz 35 Hz Disabled Description Digital: Set PWM duty cycle to N/255*100%
Description Enable auto update of digital inputs on state change Disable auto update of digital inputs on state change Enable automatic digital input update on level change Disable automatic digital input update on level change Description Set interrupt mode and arm interrupt Function disable rising edge falling edge high level low level The Interrupt returns the charcter ! when the interrupt condition is met.
38
14 Manual Operation
The oscilloscope may be operated by sending it commands from a terminal emulator. This can be useful for debugging.
14.1 Windows
The Hyperterminal program that is supplied as part of Windows operating systems is suitable for this. 1. To simplify matters, it is probably best to unplug any USB devices that are connected. 2. Plug the scope hardware into a USB port on the computer. 3. Using the steps described in section 11 above, determine the COM port that the scope is currently connected to. 4. Start Hyperterminal: Start -> Programs -> Accessories -> Communications -> Hyperterminal 5. Hyperterminal starts with a Connection Description popup window. Cancel the popup. 6. Select File -> Properties 7. Operate the Connect Using menu to select the COM port that you found previously. 8. Select Configure which pops up a Port Settings window. Most of the port settings can be left at their default values, but the baud rate (Bits per Second) must be changed to the correct value. At this time, the correct value is 38400. The correct port settings are: Bits per Second: Data bits: Parity: Stop Bit: Flow Control 230400 Baud 8 None 1 ,Hardware (RTS/CTS) Handshaking
If you have a version of the scope Tcl program that works correctly with the scope hardware, you can verify the baud rate. Load that code into a text editor and look for the baud setting. Search for a variable baud or a procedure openSerialPort. Hit OK and back out to the hyperterminal screen. 9. Issue some command from the list in section 13. Type it in followed by the Enter key. A good choice is i, which should result in a message from the scope indicating its version number.
14.2 Linux
For manual operation under the Linux operating system, you will need to communicate with the hardware using a terminal emulator program. There are two terminal emulators in common use under Linux: seyon and minicom. These may not be installed as part of your linux distribution. To check whether the program is installed, use the which command: phiscock@panther:> which seyon /usr/X11R6/bin/seyon 39
Seyon must be properly congured to be used. This is described in the document Seyon: Quick Start Guide which is on the system CDROM. Information on using minicom may be found at the following location: Using Minicom and Seyon Chapter 11 of Learning Debian GNU/Linux Bill McCarty OReilly Books, 1999 http://www.oreilly.com/catalog/debian/chapter/book/ch11_07.html 1. Plug the scope hardware into a USB port on the computer. 2. Run the command dmesg to identify the serial port that the is allocted to this USB device. It may be a few seconds before the operating system nishes its allocation, so run dmesg repeatedly until you see the serial port number, which will be something like \ttyUSB1. 3. Start the terminal communications program (Seyon or Minicom): 4. Set the port settings to: Bits per Second: Data bits: Parity: Stop Bit: Flow Control 38400 (probably) 8 None 1 Hardware
If you have a version of the oscilloscope Tcl program that works correctly with the scope hardware, you can verify the baud rate. Load that code into a text editor and look for the baud setting. Search for a variable baud or a procedure openSerialPort. 5. Issue some command from the list in section 13.2. Type it in followed by the Enter key. A good choice is i, which should result in a message from the oscilloscope indicating its version number. Now you can type in other commands.
http://www.activestate.com/Products/languages.plex?tn=1 Download the appropriate .exe le for your operating system. Run the program to install Tcl/Tk. Make a copy of the original code, of course, and put it in a safe place. Then, using a text editor, read and modify the existing code. When you want to test the code, run the wish interpreter. Execute the source command with the name of your le, and the program will execute. Repeat this cycle until you have the desired result. Wed like to hear about your work. Check out our web page for the latest contact information.
16 Sources of Information
16.1 News Groups
comp.lang.tcl Internet News Group
16.2 Websites
http://www.syscompdesign.com Latest information on Syscomp instruments and supporting software. Many useful application notes and project descriptions. http://www.tcl.tk/ Home of the Tcl Developer Xchange. Pointers to information and software downloads. http://www.activestate.com/ ActiveState is a commercial rm that sells various programming tools provides a home for the Tcl/Tk language. Free versions of Tcl/Tk are available for download from their site.
16.3 Paper
Scripting: Higher Level Programming for the 21st Century John K. Ousterhout IEEE Computer magazine, March 1998 Currently at: http://home.pacbell.net/ouster/scripting.html Also at: http://www.tcl.tk/doc/scripting.htm The denitive paper on Tcl/Tk and scripting languages in general. Ousterhoot shows a Table of Applications which have been coded in Tcl/Tk and in the C language, and the relative effort and time required for each implementation.
16.4 Textbooks
Practical Programming in Tcl and Tk, 4th Edition Brent B. Welch & Ken Jones with Jeffery Hobbs Prentice Hall PTR, 2003 The denitive reference for Tcl and Tk. Includes CDROM with Tcl and examples.
41
Tcl and the Tk Toolkit John K. Ousterhout Addison-Wesley, 1994 Now somewhat dated, but a still useful introduction to Tcl/Tk by the inventor of the language. Graphical Applications with Tcl & Tk, 2nd Edition Eric Foster-Johnson M&T Books, 1997 Very accessible introductory textbook. Tcl/Tk Tools Mark Harrison OReilly, 1997 Information on a number of extensions to Tcl/Tk. Effective Tcl/Tk Programming Mark Harrison, Michael McLennan Addison Wesley, 1998 Techniques of design for Tcl/Tk programs. Tcl/Tk for Programmers Adrian Zimmer IEEE Computer Society, 1998 An textbook on Tcl/Tk with an academic tone and exercises. Tcl/Tk for Dummies Tim Webster IDG Books, 1997 A useful introduction to Tcl/Tk. Tcl/Tk for Real Programmers Clif Flynt Academic Press, 1999 Medium to high-level material on Tcl/Tk Audio-Radio Handbook Section 2.17.2: Pink Noise Generator Editor, Martin Giles National Semiconductor, 1980 Passive pink noise lter design Available from http://www.audioxpress.com/bksprods/products/bkaa59.htm
42
Figure 16: My Computer 2. Double click on Control Panel, obtaining a screen like gure 17.
Figure 17: Control Panel 3. Double click on Add or Remove Programs, obtaining a screen like gure 18. Figure 18 lists the FTDI drivers, so they are installed. Similarily, the Tcl/Tk program for the unit should be shown on the same list under Syscomp.
43
Figure 19: System Properties 6. In gure 22, the COM Port selection is highlighted. Click on the arrow to show a selection of COM ports. Use the up and down arrow to scroll through all the COM ports. If you wish to force the hardware to use a different COM port, you may select that port number here.
45
Figure 20: System Properties, Hardware (Device Manager) Start up your web browser and double-click on File -> Open File... Move to the CD drive and open it. You should see a listing like gure 25. 2. Double click on setup.exe (gure 25) to run it. When this completes, the installation should then be complete. 17.4.2 Starting the Installation Insert the CD into the CD drive. This should start up the installation procedure by showing the screen of gure 23. If that doesnt happen, double click on My Computer and you should see the installation CD listed under Devices with Removeable Storage (gure 24). Double click on the installation CD entry, and the screen of gure 23 should appear. If that still doesnt happen, right click on the installation CD entry of gure 24. This should bring up a directory listing of the installation CD, somewhat like gure 25. Double-click on setup.htm. This should bring up the install screen of gure 23.
46
Figure 21: Serial Port Properties If that fails, start up your web browser and double-click on File -> Open File... Move to the CD drive and open it. You should see a listing like gure 25. Double-click on setup.htm. This should bring up the install screen of gure 23. If that fails, you have our permission to have a drink. Call or email us. Note: Do not run setup.exe. This le installs the Tcl/Tk program, but does not install the FTDI drivers. 17.4.3 Continuing the Installation 1. We assume that the installation screen, gure 23, is showing. 2. Click on Windows Installation: Click here. The screen of gure 26 appears. 3. Click on Next>>. The screen of gure 27 appears. Click on the icon labelled setup.exe to run it (Windows Explorer browser) or cause it to be downloaded (Firefox browser). If it is downloaded, the default location is Desktop and the icon setup.exe appears on the computer desktop. 4. In either case, double click on the icon setup.exe to run it. The screen of gure 28 appears. 47
Figure 22: Serial Port Properties, Advanced 5. Click on Next>>. The screen of gure 29 appears. This screen shows the default directory where the software will be located, for example: C:\Program Files\Syscomp\DSO-101 Unless you need to install into a different directory, we recommend that you accept the default. 6. Click on Next>>. If this directory already exists, the computer will ask you whether you really want to install to that directory anyway. Select Yes unless you have good reasons not to. The screen of gure 30 appears. Check the Create Desktop Icon and Create a Quick Launch Icon if you wish those icons to be created at this point. (We recommend the Desktop Icon.) 7. Click on Next>>. The screen of gure 31 appears. 8. Click on Install. A progress bar appears and in a second or two, the installation completes. The screen of gure 32 appears. If you elected to Create Desktop Icon in step 6, there will be an icon on the desktop labelled, for example, Syscomp Digital Oscilloscope11.
11 Maybe
48
Figure 24: My Computer Click on Finish to complete this phase of the installation. No, were not done yet. This completes the installation of the Tcl/Tk program, but the drivers still remain to be installed. The screen shown in gure 26 reappears. (Actually, its been there all along, it would be more accurate to say it is now uncovered.) 9. Click on Next. The screen of gure 33 appears. Select the version of your operating system. In this case, we assume Windows XP. Click on that selection.
49
Figure 26: Windows Software/Driver Installation 17.4.4 Installing the Drivers We are now going to install two drivers necessary for the correct operation of the device. The install procedure is the same for both drivers. Follow the steps below to install the rst driver. 1. Plug the instrument into an available USB port. 2. The Found New Hardware Wizard will appear, gure 34 on page 55. If the wizard does not appear, right-click on the My Computer icon (typically on the desktop or in the Start menu) and select Properties. The System Properties window (gure 19 on page 45) will appear. 50
Figure 28: Welcome to the Syscomp .. Setup Wizard Click on the Hardware tab and click on the Device Manager button. When the Device Manager (gure 20 on page 46) appears, select the Action menu and then Scan For Hardware Changes. Windows should detect the device and the screen of gure 34 should appear. Click Next. 3. Windows will show the screen of gure 35 and ask you if you would like to connect to Windows update to search for software. Choose No, not this time and click Next. 4. Windows will now show the screen of gure 36 on page 56 to ask how the software should be installed.
51
Figure 30: Select Additional Tasks Choose the radio button Install from a list or specific location (Advanced) and click Next. 5. Still in gure 36 on page 56: Select the radio button Search for the best driver in these locations. Uncheck the checkbutton Search removable media. Check the checkbutton Include this location in the search .
12 Isnt
12
52
Figure 31: Ready To Install 6. Still in gure 36 on page 56: Click on the Browse button and navigate to the Drivers folder located in the installation directory on your hard drive. Typically, the install directory is C:\Program Files\Syscomp\MODEL\Drivers where MODEL is WGM101 for the waveform generator and DSO101 for the oscilloscope, and C: is the letter of the hard drive. Click OK to select this driver folder as the search location. Click Next to continue. 7. Windows will detect the driver and show a progress bar, gure 37 on page 57. 8. Windows now shows the screen of gure 38 on page 57. Click Finish to complete the installation of the rst driver. Installing the Second Driver Windows will now begin to install the second driver. The Found New Hardware Wizard will appear again. This is normal, repeat the above procedure steps 1 through 8. The drivers should now be successfully installed for your device. You should only have to install the drivers once. From this point on, the computer will recognize your instrument when it is plugged into the USB port. Click Next to continue to the last step. Conguring the Software The Configure The Software Screen, gure 39 on page 58 appears. 1. Double click on the desktop program icon for the oscilloscope or waveform generator to start the instrument program. (If you didnt create a desktop icon during the installation, start the program using the Start menu.) 53
Figure 32: Completing the Syscomp .. Setup Wizard At the top of the instrument is a Connected indicator. If it is showing green, then the instrument is connected to the hardware and ready to use. No further adjustments are necessary. If the Connected indicator is showning red, then it is necessary to select the COM port according to step 2, following. 2. Click on Hardware -> Port Settings to obtain the dialog shown in gure 40 on page 58. 3. Click on Autodetect. After a few seconds, an alert should appear, indicating that the instrument has been found on a particular COM port. Click on Save and Exit. This will cause that selection of COM port to be saved in a text le, scopeport.cfg for the oscilloscope or waveport.cfg for the waveform generator. Thereafter, when you start the program, it will read this le and set the COM port appropriately. If the instrument does not connect properly at this stage, then you must manually adjust the port settings. The most likely problem is that COM ports 0 to 9 are occupied by other devices. Early versions of the software required that the Syscomp equipment occupy one of these COM ports. Consequently, it was necessary to move other (more exible) devices to available COM ports above number 9. The detailed instructions for that process are given elsewhere in this manual. The most recent version of the software is less restrictive. It has provision for manually entering the number of a COM port into this dialog. View the Device Manager, COM & LPT, properties, advanced settings and choose a suitable available unused COM port. Then enter that number into the COM port dialog of the Syscomp software.
54
55
56
57
58