> ## Documentation Index
> Fetch the complete documentation index at: https://docs.embedder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DSLogic

> Capture, trigger, decode, and analyze digital signals with a DSLogic analyzer, from the Monitor or through Embedder, without DSView.

Use a DSLogic analyzer to capture digital signals, decode buses, and measure saved captures. You can run captures from the Monitor's **Logic** tab, ask Embedder to capture for you, or run a [hardware script](https://docs.embedder.com/debug-mode/hardware-scripts.md).

Embedder supports these DSLogic models: the original DSLogic, Pro, Basic, Plus, U2Basic, U2Pro16, U3Pro16, and U3Pro32, including later Plus and U2Basic revisions. Channels, sample rates, buffer depth, and threshold controls differ between models and USB speeds, so ask Embedder to list the connected device's capabilities before you plan a capture. Hardware testing so far covers the U3Pro16 only, and not every capture mode. Check a capture against a known signal before you rely on the results, especially on another model.

## Prepare

You don't need to install DSView, Logic 2, or Python. Embedder downloads the DSLogic software it needs the first time you use the analyzer. It's available for macOS, Linux, and Windows on x64 and Arm64 computers.

1. Connect the analyzer with a data-capable USB cable.
2. Close DSView, Logic 2, and any other application holding the device.
3. Connect signal ground, then the signal channels. Check the input voltage limits for both the analyzer and the target.
4. In the Monitor, select **+**, then **Logic Analyzer** under **Views** to open a **Logic** tab.
5. Open the device chip at the start of the toolbar and choose **DSLogic**.
6. Wait while the status shows **Scanning**. The first time, it then shows **Preparing** while Embedder downloads the DSLogic software.
7. Choose your analyzer from the device chip's **DSLogic** group. Each entry shows the model, device ID, and USB speed.

When you ask Embedder to capture instead, it does the same setup first.

On Linux and Windows, USB access may need device permissions or a compatible driver. If the analyzer doesn't appear, check those first.

### Several analyzers

Device IDs follow the USB port. If you move the analyzer to another port, its ID changes, so select it again.

When other logic analyzers are also connected, tell Embedder to use the DSLogic. In a hardware script, set `"logic_provider": "dslogic"` in the run's [capture profile](https://docs.embedder.com/debug-mode/hardware-scripts.md#supply-a-capture-profile).

### Use an analyzer on a bridge host

To use an analyzer plugged into another machine, select that machine as the bridge host. See [Remote bridge](https://docs.embedder.com/integrations/remote-bridge.md). The analyzer stays on the bridge host, and Embedder sets up the DSLogic software there for you. Embedder copies each finished capture back to your project.

The bridge must allow instruments. Bridges set up with `embedder bridge install-service` or `embedder bridge start` allow them by default. If you wrote the bridge configuration yourself, set `instruments_enabled = true` in its `config.toml`. Update older bridges before using DSLogic.

## Capture from the Monitor

1. Select the **Logic setup** chip next to the device chip. It summarizes the current setup and opens the **Logic analyzer setup** panel on its **Setup** view.
2. Under **Channels**, choose the channels. Under **Acquisition**, set the **Sample rate**, **Samples**, **Mode**, and **Threshold**. The panel shows the resulting **Duration**.
3. Optionally, set a trigger in **Trigger** and protocol decoders in **Decoders**.
4. Select **Single** to capture once. When a trigger is set, the capture arms and waits for the trigger.
5. To capture repeatedly, set **Repeat** or turn on **Rolling stream** under **Advanced acquisition**, then select **Run**.
6. Select **Stop** to end the capture early.

To capture immediately and ignore the trigger for one run, choose **Instant capture** from the **⋯** (**Analyzer actions**) menu.

The status shows **Preparing**, **Scanning**, **Ready**, **Arming**, **Waiting for trigger**, **Running**, **Uploading**, **Done**, or **Error**. If the channel, rate, and depth combination doesn't fit the connected device and USB connection, the tab says so before you start. The finished capture opens in the waveform view and in **Capture history**. To zoom, pan, or jump to a sample range, see [Navigate the waveform](https://docs.embedder.com/debug-mode/logic-analyzer.md#navigate-the-waveform).

The **Analyzer actions** menu at the end of the toolbar also holds **Import DSView capture…**, **Custom decoder packages…**, **Refresh devices**, **Run internal diagnostic**, and **Repair analyzer connection**.

### Acquisition settings

| Setting | Values |
| - | - |
| **Channels** | Select channels by number, starting at `D0`, or use **All** or **None**. |
| **Sample rate** | A rate the device offers for the selected channels and mode. |
| **Samples** | Capture length in samples. **Duration** shows the resulting time. Hardware depth and free disk space limit the length. |
| **Mode** | **Auto** picks a device-buffer setup that fits, then streaming. **Buffer** captures into the analyzer's memory. **Stream** sends samples over USB as they arrive. |
| **Threshold** | 0 to 5 V in 0.1 V steps on models with an adjustable threshold. Older models offer **3.3 V logic** or **5 V logic**. Leave it at **Device default** to keep the analyzer's setting. |

Under **Advanced acquisition**:

| Setting | Values |
| - | - |
| **Clock** | **Internal**, **External rising edge**, or **External falling edge** |
| **Glitch filter** | **Off** or **1 sample** |
| **On stop** | **Keep captured data** keeps samples captured before a stop. **Discard capture** drops them. |
| **Timeout** | Longest time, in seconds, to wait for the capture, including any wait for the trigger |
| **Repeat**, **Interval** | Run the capture this many times, waiting the interval in seconds between runs |
| **Keep last** | How many repeated captures to keep |
| **Hardware RLE** | Compresses repeated samples in buffer mode. Achievable depth depends on signal activity. |
| **Rolling stream** | Streams continuously and keeps the latest window of **Samples**, which must be a multiple of 64. Ignores triggers. |

With an external clock, the rate field becomes **Nominal rate**, and the rate you enter is only an assumption. **Duration** shows **External clock**. Embedder reports positions in samples, leaves out frequency and time measurements, and labels the waveform axis in samples.

### Save and reuse settings

At the bottom of the **Setup** view, choose a saved setup from **Profile**, or select **Save** to name and save the current setup. To delete a profile or reload the list, open the **Profile actions** menu. Choose **Default settings** from **Profile** to start over. Profiles are saved with the project on the computer the analyzer is plugged into: yours, or the bridge host. Loading a profile never starts a capture.

## Ask Embedder to capture

Give the channel map, sample rate, capture length, threshold, and trigger:

```text theme={"theme":"css-variables"}
Use the DSLogic. Capture SDA on channel 0 and SCL on channel 1 at 10 MHz for
one second with a 1.6 V threshold. Decode I2C and save the capture.
```

While the capture runs, the **Logic** tab shows a live preview and its progress.

## Set a trigger

In **Trigger**, choose a trigger type:

| Type | How it works |
| - | - |
| **Immediate** | No trigger; the capture starts at once. |
| **Edge** | Choose a **Channel** and an **Edge**: rising, falling, or either. Under **More conditions**, set other channels to **Ignore**, **Low**, **High**, **Rising**, **Falling**, or **Either edge**. |
| **Pattern** | Up to 16 stages; select **+ Add stage** for each. Each stage has **Pattern A** and **Pattern B**, with 32 symbols from D31 down to D0: `0`, `1`, `X` (ignore), `R`, `F`, or `C` (either edge). Combine them with **AND** or **OR**, and set **Contiguous**, **Invert A**, **Invert B**, **A count**, and **B count**. |
| **Serial** | Set **Start**, **Stop**, and **Clock** patterns from D31 to D0, a **Data channel**, **Bits** from 1 to 16, and a **Data** pattern of `0`, `1`, or `X`, highest bit first. |

**Pre-trigger** sets how much of the capture comes before the trigger, from 1 to 90 percent. Streaming captures accept only **Edge** triggers, with at most 1 percent pre-trigger.

**Instant capture** ignores the trigger for one run and keeps your saved trigger settings.

## Decode a bus

DSLogic decoding uses a catalog of 158 decoder modules, which counts protocol variants separately. Decoding runs after acquisition, so you can decode a long capture, or a region of it, after it is saved.

To add decoders in the Monitor:

1. In the **Setup** view of the **Logic analyzer setup** panel, select **+ Add** in **Decoders**.
2. Choose the decoder and assign its channel roles and options.
3. To decode a higher-level protocol on top of the first, select **Add layer**.
4. Capture as usual. Decoded rows appear on the waveform.

You can also ask Embedder to decode with the protocol settings you need, for example UART baud rate and framing, SPI clock polarity, phase, and bit order, or I2C SDA and SCL.

Scripts written for [Saleae](https://docs.embedder.com/debug-mode/saleae.md) can decode a DSLogic capture with the same analyzer names and options. Some defaults differ:

| Protocol | Default |
| - | - |
| UART | 9600 baud |
| LIN | 20000 baud. `lin_version` accepts `Version 1.x` or `Version 2.x`. |
| Modbus | 9600 baud, 8E1, RTU client. Set `mode="ASCII"` for 7E1 ASCII, or `direction="server"` for responses. |
| I2C | `address_mode` changes only how addresses are displayed. |

CAN decoding shows frames. To interpret application-level signals with your project's database, use [CAN Monitor](https://docs.embedder.com/debug-mode/can.md).

### Add custom decoders

To add your own decoders, choose **Custom decoder packages…** from the **⋯** (**Analyzer actions**) menu. Enter the **Package ZIP path**, select **I trust this package and allow its Python code to run**, then select **Install decoder package**. Installing runs the package's Python code, so install only packages you trust.

A package is a ZIP file of up to 20 MiB that contains:

* A `decoder-package.json` file with `format` set to `embedder-dslogic-decoders-v1`, plus `name`, `version`, `license`, `source`, and a `files` map that lists the SHA-256 hash of every file.
* A folder for each decoder with complete `__init__.py` and `pd.py` files.

Custom decoders can't replace built-in ones. A project can hold up to 32 packages, stored on the computer the analyzer is plugged into: yours, or the bridge host.

## Analyze a saved capture

When a DSLogic capture is open, switch the **Logic analyzer setup** panel to its **Analyze** view. It offers these tools:

| Tool | What it does |
| - | - |
| **Measure** | Reports rising, falling, and total edges, duty cycle, mean period, and mean high and low pulse widths for a channel and region. Frequency appears for internal-clock captures. |
| **Search** | Finds where channels match a pattern of **Low**, **High**, **Rising edge**, **Falling edge**, **Either edge**, or **Don't care**. Select a match to jump to it. |
| **Decode** | Searches decoded results in a region and exports them as CSV, TXT, or binary. Search a binary output stream for a byte sequence. Under **Saved decoders**, select **Load saved decoders**, change the decoders, and select **Apply and decode region**. If any decoder fails, the previous results are kept. |
| **Channels & cursors** | Renames, reorders, groups, colors, resizes, or hides channels, and adds named cursors. Select **Save presentation** to keep the changes. |
| **Export** | Exports a sample region or the whole capture in the formats below. |

To add a cursor on the waveform, hover and press `C`, or Shift-click. **Save view as PNG** in the waveform's **View actions** menu saves the visible waveform.

| Export format | Contents |
| - | - |
| **Compressed CSV (transitions)** | One row per change |
| **Raw CSV (every sample)** | One row per sample |
| **VCD** | Value change dump for waveform viewers |
| **Gnuplot** | Plot-ready samples |
| **32-bit binary** | Packed samples that keep each channel's bit position |
| **PNG waveform image** | The waveform with cursors and decoder annotations |
| **DSView file (whole capture)** | A `.dsl` file for DSView |

## Save and reopen captures

Captures you take in the Monitor, and captures a script saves with `la_save_capture()`, go into your project's capture history as a `.dslogic.json` file with companion data files. Keep them together. Reopen any capture from **Capture history** in the **Logic** tab.

To bring in a DSView capture, choose **Import DSView capture…** from the **⋯** menu. Enter the **DSView file path** and select **Import .dsl**. Use a path on the machine running Embedder; relative paths start at the project folder. Import keeps the original file and adds a copy to capture history. Decoders saved in the DSView file are kept for review, but Embedder doesn't run them until you re-decode.

## Use DSLogic in a hardware script

In a [hardware script](https://docs.embedder.com/debug-mode/hardware-scripts.md), configure the capture with `la_start_capture()`, finish it with `la_wait()` or `la_stop()`, and save it with `la_save_capture()`:

```python theme={"theme":"css-variables"}
capture = la_start_capture({
    "channels": [0, 3],
    "sample_rate": 1000000,
    "sample_count": 1000000,
    "mode": "buffer",
    "threshold_volts": 1.6,
    "trigger": {"mode": "simple", "channels": {"0": "R"}, "position_percent": 25},
    "clock": "internal",
    "filter": "none",
    "stop_policy": "upload",
    "timeout_seconds": 60,
})
la_wait(capture)
la_save_capture(capture)
```

| Option | Values |
| - | - |
| `channels` | Channel numbers, starting at 0. The channel set and rate must match a mode the device offers. |
| `sample_count` or `duration_seconds` | Set one, not both. |
| `mode` | `buffer`, `stream`, or `auto` (default) |
| `threshold_volts` | 0 to 5 V in 0.1 V steps on adjustable models; 3.3 or 5 on older models. Omit it to keep the device default. |
| `trigger` | `mode` of `simple` (the Monitor's **Edge**), `advanced` (**Pattern**), or `serial`, with the settings from [Set a trigger](#set-a-trigger). `simple` takes `channels`, a map from channel number to `0`, `1`, `R`, `F`, or `C`. `advanced` takes `stages`, a list of 1 to 16 stages, each with `pattern0`, `pattern1`, `logic` (`and` or `or`), `contiguous`, `invert0`, `invert1`, `count0`, and `count1`. `serial` takes `start`, `stop`, `clock`, `data_channel`, `bits`, and `data`. `position_percent` sets the pre-trigger, from 1 to 90. |
| `clock` | `internal`, `rising`, or `falling` |
| `filter` | `none` or `1t` |
| `rle` | `True` enables hardware RLE. Buffer mode only. |
| `loop` | `True` selects rolling streaming and ignores triggers. `sample_count` must be a multiple of 64. |
| `stop_policy` | `upload` keeps data captured before a stop; `discard` drops it. |
| `timeout_seconds` | Longest wait for the capture, from 1 to 86400 seconds |
| `instant` | `True` ignores the trigger for this run. |
| `device_id` | The device ID, when several DSLogic units are connected |

Other useful helpers:

| Task | Helpers |
| - | - |
| Find and select a device | `la_get_devices()`, `la_connect(device_id)` |
| Check progress | `la_get_capture_status()` |
| Decode | `la_get_protocol_decoders()`, `la_decode()`, or the Saleae-style `la_add_protocol_analyzer()` and `la_export_table()` |
| Measure and search | `la_measure()`, `la_search()` |
| Work with decoded results | `la_decoder_results()`, `la_export_decoder_results()`, `la_redecode()` |
| Export | `la_export_raw()` for Saleae-style transition CSV, `la_export_samples()` for CSV, VCD, Gnuplot, or binary, `la_export_screenshot()` for PNG |
| Reopen and exchange | `la_open_capture()`, `la_import_dsl()`, `la_export_dsl()` |

`la_start_timed_capture()` and `la_start_manual_capture()` also work, so scripts written for other analyzers run on a DSLogic.

## Limits

* DSLogic is digital only. Analog capture and Saleae `.sal` files are not available.
* Rolling captures can't use device-buffer mode or hardware RLE.
* Rates and thresholds differ between models and USB speeds. Don't reuse one model's settings on another.

## Troubleshoot

* **No DSLogic detected:** check the USB cable and port, and on Linux or Windows, the USB permissions or driver. Then choose **Refresh devices** from the **⋯** menu.
* **Device busy:** close DSView, Logic 2, or another script using the analyzer.
* **Download or setup failed:** check the network connection, then choose **Repair analyzer connection** from the **⋯** menu.
* **"DSLogic runtime is unavailable for this platform":** the computer isn't macOS, Linux, or Windows on x64 or Arm64. Connect the analyzer to a supported computer.
* **"The connected DSLogic revision or USB speed is not supported by this runtime":** try another USB port or cable, then check that the model is listed above.
* **"The channel, rate and depth combination is unavailable on this USB connection":** lower the sample rate or sample count, or select fewer channels.
* **Wrong analyzer selected:** tell Embedder to use the DSLogic, or set `"logic_provider": "dslogic"` in the capture profile. With several DSLogic units, select the device by ID.
* **Check the analyzer itself:** choose **Run internal diagnostic** from the **⋯** menu, when the model supports it. It runs the analyzer's built-in test mode. The result is labeled as diagnostic data.
* **Not available on a bridge host:** the bridge must allow instruments and be up to date. If the bridge restricts which commands it may run, automatic DSLogic setup is refused on that bridge host.

See [Logic analyzer](https://docs.embedder.com/debug-mode/logic-analyzer.md) to compare instruments, or use an [oscilloscope](https://docs.embedder.com/debug-mode/oscilloscope.md) for voltage levels and ringing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.