Oscilloscopes

From sigrok
Revision as of 14:32, 20 January 2014 by Bert (talk | contribs)
Jump to navigation Jump to search

This page documents the config keys are various other info needed to write a libsigrok frontend for controlling oscilloscopes.

Frame-based

Generally oscilloscopes work by triggering on either the signal under measurement, or some external trigger. The device then measures as much as its internal buffer can hold. When the buffer is full, the device stops measurement and sends its buffer over to the libsigrok driver. This transfer represents a frame's worth of data. The driver converts this data to the libsigrok internal analog format and sends it out to the frontend like this:

Packet type Payload
SR_DF_FRAME_BEGIN
SR_DF_ANALOG analog data
SR_DF_ANALOG...
SR_DF_FRAME_END

The oscilloscope then restarts acquisition, sometimes after prodding by the driver. The data received from an oscilloscope is thus not contiguous from one frame to the next: in between there is a period where no measurements are done by the device.

Streaming

Some devices can act as continuously streaming oscilloscopes, with no framing involved. Notably FX2-based devices with an analog frontend, such as the Nexus-Computing OsciPrime, work this way.


Config keys

A libsigrok driver for an oscilloscope implements all or some subset of the following config keys.

SR_CONF_OSCILLOSCOPE

Denotes a device that can act as an oscilloscope, i.e. measure voltage over time on one or more analog channels, and send those measurements out to the frontend as analog values.

SR_CONF_LIMIT_FRAMES

Frame-based oscilloscopes implement this key set to the number of frames to capture and send out, between SR_DF_FRAME_BEGIN and SR_DF_FRAME_END packets.

It is only used to set this value; getting it will just return the previously set value. Defaults to 0, meaning continuously grab frames until told to stop.

Type {{{type}}}
Get NA
Set NA
List NA

SR_CONF_NUM_TIMEBASE

The number of divisions an oscilloscope has across its horizontal (time) axis. This corresponds to the areas marked off by the vertical lines on the graticule of the device's display. Even on headless oscilloscopes, this concept still exists; for example the SR_CONF_TIMEBASE setting is meaningless without this number.

Type {{{type}}}
Get NA
Set NA
List NA

SR_CONF_TIMEBASE