> ## 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, and decode digital signals with a DSLogic analyzer without DSView.

Embedder drives DSLogic analyzers headlessly. Captures appear in the Monitor's **Logic** tab, and hardware scripts use the same `la_*` helpers as other logic analyzers. You do not need DSView or Logic 2.

Supported model profiles cover the original DSLogic, Pro, Basic, Plus, U2Basic, U2Pro16, U3Pro16, and U3Pro32. Channels, sample rates, buffer depth, and threshold controls differ between models and USB speeds. Ask Embedder to list the connected device's capabilities before configuring a capture. Only the U3Pro16 has been checked on hardware, so check other models against a known signal first. On Linux and Windows, USB access may require device permissions or a compatible driver.

## Prepare

1. Connect the analyzer with a data-capable USB cable.
2. Close DSView, Logic 2, or any other application holding the device.
3. Connect signal ground and the signal channels. Check the input voltage limits for the analyzer and target.

Embedder downloads a versioned DSLogic runtime the first time you capture or analyze a saved capture. The runtime includes acquisition, decoding, firmware, and an isolated Python. Embedder verifies the package checksum and contents before activating it. You do not need to build anything or install Python.

In the Monitor's **Logic** tab, select **DSLogic** as the source. Embedder prepares the runtime automatically and shows **Preparing analyzer…** while it downloads. If the runtime or device needs attention, open the **⋯** (**Analyzer actions**) menu and choose **Repair analyzer connection**. **Refresh devices** rescans USB.

To use an analyzer attached to another machine, select a [remote bridge](/integrations/remote-bridge) host with `instruments_enabled` set. The Bridge host owns USB access, and Embedder transfers capture archives back to your project. Update older Bridges before using DSLogic.

Channel indexes are zero-based. When several DSLogic units are connected, pass the device `id` from `la_get_devices()` to `la_connect()`. Device IDs follow USB topology and change if you move the analyzer to another port. When other logic analyzers are also connected, add `"logic_provider": "dslogic"` to the run's [capture profile](/debug-mode/hardware-scripts#supply-a-capture-profile), or tell Embedder to use the DSLogic.

## Capture digital traffic

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

```text theme={"system"}
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.
```

In a hardware script, configure the capture with `la_start_capture()`, complete it with `la_wait()` or `la_stop()`, and save it with `la_save_capture()`:

```python theme={"system"}
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` | Zero-based channel indexes. The channel set and rate must match a mode the device advertises. |
| `sample_count` or `duration_seconds` | Specify one. Hardware depth and free disk space limit the capture length. |
| `mode` | `buffer`, `stream`, or `auto`. `auto` prefers a buffer configuration that fits, then streaming. |
| `loop` | `True` selects rolling streaming and ignores triggers. Retention depth must be a multiple of 64 samples. |
| `threshold_volts` | 0–5 V in 0.1 V steps on adjustable models. Older models accept the 3.3 V or 5 V presets. Omit it to keep the driver default. |
| `clock` | `internal`, or an external clock on the `rising` or `falling` edge. |
| `filter` | `none` or `1t`. |
| `rle` | `True` enables hardware run-length encoding. Requires buffer mode. Achievable depth depends on signal activity. |
| `stop_policy` | `upload` keeps the data captured before a stop. `discard` drops it. |
| `instant` | `True` ignores trigger conditions for that run. |

With an external clock, the configured rate is nominal. Embedder reports positions in samples, omits frequency and time measurements, and labels the Monitor axis in samples.

`la_start_timed_capture()` and `la_start_manual_capture()` remain available for scripts written for other analyzers. `la_get_capture_status()` reports acquisition, trigger, and upload progress while the Monitor shows a live preview.

## Set a trigger

The trigger `position_percent` sets the pretrigger amount from 1 to 90 percent. Streaming captures accept simple triggers with at most 1 percent pretrigger.

* **Simple:** map channels to `0`, `1`, `R` (rising), `F` (falling), or `C` (any change).
* **Advanced:** use 1–16 stages. Each stage has 32-character `pattern0` and `pattern1` strings, highest physical channel first, with `X` for don't care. Stages also accept `logic` (`and` or `or`), `contiguous`, `invert0`, `invert1`, `count0`, and `count1`.
* **Serial:** set 32-character `start`, `stop`, and `clock` patterns, a `data_channel`, `bits` (1–16), and `data` as 0/1/X, highest bit first.

The Monitor's **Instant** button ignores the trigger for one run and keeps the saved trigger profile.

## Decode a bus

`la_get_protocol_decoders()` lists 158 decoder modules, including variants and an example module. `la_decode(capture, stack, start_sample=0, end_sample=None)` runs a decoder stack with the roles and options from that catalog.

Decoding runs separately from USB acquisition, so you can decode a long capture or a region of it after saving.

`la_add_protocol_analyzer()` also accepts the Saleae analyzer names and options, so a script written for [Saleae](/debug-mode/saleae) can decode a DSLogic capture:

```python theme={"system"}
uart = la_add_protocol_analyzer(capture, "uart", {"input": 0}, {
    "bit_rate": 115200, "bits_per_frame": 8, "parity_bit": "even", "stop_bits": 2,
})
la_export_table(capture, uart, "uart.csv")
```

* UART defaults to 9600 baud.
* LIN defaults to 20000 baud and accepts `lin_version` values `Version 1.x` or `Version 2.x`.
* Modbus defaults to 9600 baud, 8E1, RTU client mode. Set `mode="ASCII"` for 7E1 ASCII decoding or `direction="server"` for responses.
* I2C `address_mode` changes only how addresses are displayed.

CAN decoding shows frames. Use [CAN Monitor](/debug-mode/can) with a project database for application-level signals.

## Save and analyze

`la_save_capture(capture, filename="capture.dslogic.json")` saves a `.dslogic.json` archive into the project's capture history. The metadata file and its companion files belong together. `la_open_capture(filename)` reopens the archive.

Saved captures support further analysis:

* `la_measure()` reports edge counts, duty cycle, pulse widths, and period for a channel.
* `la_search()` finds channel patterns of `0`, `1`, `R`, `F`, `C`, and `X`.
* `la_decoder_results()` and `la_export_decoder_results()` search and export decoded annotations and packets.
* `la_redecode()` replaces a capture's decoders and keeps the previous results if any decoder fails.
* `la_export_raw()` writes Saleae-compatible transition CSV. `la_export_samples()` writes CSV, VCD, Gnuplot, or binary samples.
* `la_import_dsl()` and `la_export_dsl()` read and write DSView `.dsl` logic archives. Embedder does not run decoders from an imported file.
* `la_export_screenshot()` saves a PNG of the waveform with cursors and decoder annotations.

## Limits

* DSLogic is digital-only. Analog capture and Saleae `.sal` files are not supported.
* Loop captures cannot use buffer-only mode or RLE.
* Rates and thresholds differ between models and USB speeds. Do not reuse one model's settings on another.

## Troubleshoot

* **Device busy:** close DSView, Logic 2, or another script using the analyzer.
* **Runtime needs setup or repair:** choose **Repair analyzer connection** from the **Logic** tab's **⋯** menu. If the download fails, check the network connection.
* **Wrong analyzer selected:** set `"logic_provider": "dslogic"` in the capture profile and pass the device `id` to `la_connect()`.
* **Requested rate rejected:** choose a rate and channel set the connected device advertises.
* **Device missing on a Bridge:** confirm that the Bridge host has `instruments_enabled` set and is up to date.

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


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