Oscilloscope

An oscilloscope (or “scope”) allows you to view a signal's waveform, typically in a two-dimensional graph where one or more electrical signals (on the vertical axis) are plotted as a function of time or of some other voltage (on the horizontal axis).

Most of the time, oscilloscopes are used to show events that repeat with either no change or events that change slowly.


1. Menu

See Menu in Common Interfaces.

1.1. View



2. Control

The Control toolbar allows you to stabilize repeating waveforms and capture single-shot waveforms. By default, this only shows the most important options. The down/up arrow in the top right corner shows/hides the other features.

3. Channels

This toolbar contains the time and channel configuration groups. The toggle button in the top-left corner enables/disables the auto hiding of this toolbar.

The Add Channel button opens a drop-down with the following options:

The check-box before the group name enables or disables the respective channel. The drop-down properties button in the top-right corner allows you to configure the channel properties. The math and reference channels also have a close button.

 

3.1. Time Group

Use the time group to position and scale the waveform horizontally using the time base and the horizontal trigger position controls.

In the property drop-down, the following can be configured:

Digital:

 

3.2. Real Channels

Use the real channel (vertical controls) to position and scale the waveforms vertically using the offset and range controls for each channel.

In the property drop-down, the following can be configured:


Input Coupling

Coupling is the method used to connect an electrical signal from one circuit to another. In this case, the input coupling is the connection from your test circuit to the oscilloscope.

On the Electronics Explorer board, the input coupling AC and DC are separate input connectors on the board with AC and DC marks. On the Analog Discovery BNC Adapter jumper, select between AC and DC coupling. DC coupling shows all of an input signal. AC coupling blocks the DC component of a signal so that you see the waveform centered at zero volts.

The following diagram illustrates this difference. The AC coupling setting is handy when the entire signal (alternating plus continuous components) is too large for the volts/div setting.

DC coupling AC coupling
2V peak-to-peak sine wave with 2V DC component

3.3. Math Channels

The integrated mathematical functions allow you to perform a variety of mathematical calculations on the input signals of the oscilloscope. Simple and Custom math channels can be added with the “Add Channel” button from the Channels. The simple math channel can be configured to add, subtract, multiply, or divide two channels. The mathematical operations are performed by the PC, so the oscilloscope device cannot trigger on these channels. The measurement units for the math channel can be specified, for instance: A, V, W.

In the property drop-down, the following can be configured:


Custom Math Channel

The custom or simple math channel can be selected under the channel properties, as shown below.

The Custom Math Function editor can be launched with the bottommost button showing the formula.

You can type the custom function in the Enter Function text box. If the entered function is valid, the resulting number for one sample is displayed, otherwise the error description is listed.

Click Apply to apply changes. Click OK to save the last valid function. Click Cancel to use the function saved before the editor was opened.

See Script in Common interfaces. The local variables are real, while the reference and math channels will have a smaller index, such as: C1, C2, R1, M1. In the M1 function, no other math channel can be used. In M2, the M1 can be used, while in M3, the M1 and M2 can be used.

Example functions:

 

3.4. Reference Channels

The reference channels can be added using the “Add Channel” button from the Channel toolbar.

In the property drop-down, the following can be configured:

 

4. Main Plot


  1. The center of the display is marked with grid lines. Each vertical and horizontal line constitutes a major division. These are laid out in a 10-by-10 division pattern. The tick marks on the sides between major divisions are called minor divisions. The labeling on the oscilloscope controls (volts/div and sec/div) always refer to major divisions.
  2. On the left side of the view, the horizontal voltage grid line marks are shown for the active channel. Left-mouse dragging changes the offset and right-dragging adjusts the range of the active channel.
  3. The time marks of the vertical grid lines are located at the bottom. Left-mouse dragging changes the time (trigger horizontal) position and right-dragging adjusts the time base.
  4. On the right side of the view, left-mouse dragging changes the vertical trigger level and right-dragging adjusts the hysteresis level.
  5. On the top side, information about the viewed acquisition is displayed: number of samples, rate, and capture time.
  6. The channel list colors make channel identification easy. Left-mouse clicking the rectangle activates the channel. A right-mouse click disables/hides it.
  7. The status label shows the state of the oscilloscope. See Acquisition States for more information.
  8. The horizontal trigger position arrow can be dragged with the mouse.
  9. The zero point arrows for each channel can be dragged with the mouse to change the vertical position (offset).
  10. The vertical trigger position arrow can be dragged with the mouse to change the trigger level. The two smaller arrows represent the low and high levels (hysteresis).
  11. See Plots in Common Interfaces.
  12. Noise band which indicates a glitch or components which have a frequency higher than the sampling frequency. See Real channels options.

 

4.1. HotTrack

See HotTrack in Common Interfaces.

When the mouse cursor position is in the signal view, it will place a vertical cursor along with two more horizontal ones towards the right, measuring the pulse-width, the period, the frequency, and the duty cycle. Otherwise, it will place a single vertical cursor showing the time position and the waveform's level at the intersections with the vertical cursor.

 

4.2. Cursors

The X and Y cursors are available for main time view. See Cursors.

The X cursor's drop-down menu contains adjustment controls for the position, reference cursor, delta x value, and remove button.

The Y cursor's drop-down menu contains adjustment controls for the channel, position, reference cursor, delta value, and remove button.

 

4.3. Digital Channels

The Logic Analyzer can be enabled inside the Oscilloscope interface by adding digital channels, or by enabling from the view menu.

The picture below shows the digital input and analog output of a resistor network.

 

5. Views

5.1. FFT

The FFT view plots amplitude versus frequency. In other words it shows signals in the frequency domain, as opposed to the time view, which shows signals in the time domain as amplitude versus time. It is especially useful for tracking down the cause of noise or distortion in measured signals.

This view contains a subset of Spectrum Analyzer instrument features. To have more options, use this instrument.

The FFT toolbar only shows the most important options by default. The down/up arrow in the top-right corner shows/hides the other features. This toolbar contains the following:

The gear drop-down contains the following options:

 

5.2. XY

Using the XY view allows you to plot one channel against another. This plot could be the I-V curve of a component such as a capacitor, inductor, a diode, or a Lissajous figure showing the phase difference between two periodic waveforms. XY view is also capable of more advanced operations, such as plotting a math channel against a reference waveform.

The channels for X and Y representation can be selected on the top side and in the properties button in the top-left corner beside the other plot options.


5.3. Histogram

A histogram is a graphical representation of the voltage distribution in a signal waveform. It plots the distribution of values for each voltage value, with the number of times the signal has a certain voltage value represented as a percentage.

The picture below shows the histogram view of a sine and another signal.

The Auto scale option adjust the scale for each channel separately based on the maximum value. With manual scale a common Top level can be specified.


5.4. Data

The Data view displays the acquisition samples and the time stamps.


The column header shows the sample index, the first column shows the time stamp, followed by the values for channels.

The selected cells can be copied and pasted to other applications.

 

5.5. Measurements

The Measurements view shows the list of the selected measurements.

The first column in the list shows the channel, the second shows the type, and the third shows the measurement result. See the mouse operations found in the Lists section.

Pressing the Add Default Measurement button opens the Add Measurement window. On the left side is the channel list, and on the right side is a tree view containing the measurement types in groups. Pressing the Add button here (or double-clicking an item) adds it to the measurement list.

The Show menu options allows you to create statistics out of measurements between acquisitions, which can be cleared with the Reset button.


Vertical-axis measurements for each channel: Horizontal-axis measurements for each channel:

The Add/Custom Channel measurement opens a script editor with an average calculation example script. Here a custom measurement involving one channel's data can be created. This will be added to the Defined Measurement Custom category list to be used for other channels. See the predefined vertical measurements that can be opened with Edit as read-only examples.

See Script in Common interfaces. In the Locals menu you can find Time and Channel which are two script specific objects.

Average calculation:

// initialize a local variable
var value = 0
// loop to access each sample
Channel.data.forEach(function(sample){
// make sum of samples
    value+=sample
})
// divide the sum with the number of samples to get the average
value /= Channel.data.length
// last line of code is the measurement value

Accessing other measurements, calculating peak-to-peak value:

Channel.measure("Maximum") - Channel.measure("Minimum")


The Add/Custom Global measurement opens a script editor with an phase calculation example script. Here custom measurement accessing multiple channels can be created. The Local is the instrument object called Scope.

Phase calculation:

// initialize local variables
var sum1 = 0
var sum2 = 0
var sum12 = 0
// for better performance get and use local copy of data array
var d1 = Scope.Channel1.data
var d2 = Scope.Channel2.data
var c = d1.length
for(var i = 0; i < c; i++){
    sum1 += d1[i]*d1[i]
    sum2 += d2[i]*d2[i]
    sum12 += d1[i]*d2[i]
}
sum1 /= c
sum2 /= c
sum12 /= c
// last line of code is the measurement value
Math.acos(sum12/Math.sqrt(sum1*sum2))*180/Math.PI

Accessing other measurements, calculating gain in dB:

Math.log(Scope.Channel1.measure("Amplitude")/Scope.Channel2.measure("Amplitude"))/Math.LN10


The Edit opens the script editor for custom measurements. The predefined Vertical and Horizontal measurements for performance reason are hard-coded and some are shown as read-only example scripts in the editor.

 

5.6. Logging

See Logging in Common Interfaces.

The script allows custom saving of data, logging, or processed information. Scope is a local object. Index and Maximum are the values shown above the script.

// local variable
var ch = Scope.Channel1
// condition for saving, average measurement to be less than 5 V
if(ch.measure("Average")<5)
{
    // instantiate file object for acquisition and write channel data
    File("C:/temp/acq"+Index+".csv").write(ch.data)
    // file file for measurements
    var filem = File("C:/temp/measure.csv")
    // in case file does not exists
    if(!filem.exist())
    {
        // write (erasing earlier content) the header line
        filem.writeLine("Time,Average,Peak2Peak")
    }
    // append line with measurement we want to save
    var textm = Date()+","+ch.measure("Average")+","+ch.measure("Peak2Peak")
    filem.appendLine(textm)
    // increment Index
    Index++
}

 

5.7. X Cursors

The X Cursors show cursor information in table view. See Cursors.

This table shows additional information to cursor tooltips: the 1 / delta x frequency, delta y vertical difference, and delta y / delta x.

 

5.8. Y Cursors

The Y Cursors show cursor information in table view. See Cursors.

 

6. Export

See Export in Common Interfaces.