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

# Saleae Logic

> Connect a Saleae analyzer through Logic 2, capture digital traffic, decode buses, and export raw and decoded results.

Use a Saleae Logic analyzer to capture digital timing and decode buses. Inlay runs the captures through Saleae's Logic 2 app, and each capture opens in the Monitor's **Logic** tab. Plug the analyzer into the computer where Inlay runs, and run Logic 2 on that computer.

## Prepare Logic 2

1. Connect the analyzer by USB and open Logic 2.
2. In Logic 2 **Preferences**, turn on the automation server (the Automation API). Keep the default port, `10430`; Inlay connects on that port.
3. Leave Logic 2 running while you capture.
4. Ask Inlay to check the analyzer. The first time, approve the setup prompts:
   * **Install Python 3?** if Python is missing.
   * **Create Inlay Python environment?**
   * **Install logic2-automation?**, Saleae's automation package.
5. Connect ground first, then the signal channels. Check the voltage limits for both the analyzer and the target.

Inlay looks for a Saleae device on USB before it offers any setup. If it doesn't find one, setup doesn't start, so connect the analyzer first.

### Channel numbers and thresholds

Inlay counts channels from 0. On the Original Logic, the housing labels run from 1 to 8, so housing channel 1 is channel 0 and housing channel 8 is channel 7.

| Model | Digital sample rate | Threshold |
| - | - | - |
| Original Logic | Up to 24 MS/s on all 8 channels | Fixed |
| Logic 8 | Up to 100 MS/s (3 channels), 50 MS/s (6), 25 MS/s (8) | Fixed |
| Logic Pro 8 | Up to 500 MS/s (4 channels), 100 MS/s (8) | 1.2 V, 1.8 V, or 3.3 V |
| Logic Pro 16 | Up to 500 MS/s (4 channels), 300 MS/s (8), 100 MS/s (16) | 1.2 V, 1.8 V, or 3.3 V |

Don't request a threshold on a model with a fixed threshold; the capture fails. For other models, ask Inlay which rates and thresholds the connected device reports. On the Original Logic, a busy USB 2.0 host can limit the rate to 16 or 12 MS/s.

Inlay captures digital channels only. Use an [oscilloscope](/docs/debug-mode/oscilloscope.md) for analog measurements.

## Capture digital traffic

Give Inlay the physical channel map, duration, sample rate, and the activity you expect:

```text theme={"theme":"css-variables"}
Use the Saleae Original Logic. Capture SDA on housing channel 1 and SCL on
housing channel 2 for two seconds. Decode I2C and save raw and decoded results.
```

Choose the capture type that fits the test:

| Capture | Use it when | How it ends |
| - | - | - |
| Timed | The test has a fixed length | After the duration you set |
| Manual | The operation's length varies | When you or the script stops it |

For a manual capture, ask Inlay to start the capture, perform the operation, then stop the capture before exporting it. To run the capture and the operation in a fixed order, put both in one [hardware script](/docs/debug-mode/hardware-scripts.md).

A timed capture can start immediately or wait for a rising or falling edge on one enabled digital channel. Without a trigger, start the capture before the event and keep enough margin on both sides.

The connected model and the number of enabled channels determine which sample rates are available. If you request an unsupported rate, Inlay uses the nearest supported rate and reports the change. Check the reported rate before you calculate pulse widths or compare runs.

If several Saleae analyzers are connected, say which one to use. Inlay can list the device IDs Logic 2 sees.

## Capture from the Monitor

With Logic 2 running and its automation server on, you can capture from the Monitor's **Logic** tab without asking Inlay.

1. In the Monitor, select **+**, then select the analyzer under **On the bench**. Or open **Logic Analyzer** under **Views** and choose the analyzer from the device chip.
2. If the toolbar shows **Set up & connect** or **Connect**, select it. Selecting **Set up & connect** approves setup.
3. Select the **Logic setup** chip, the settings summary next to the device chip, to open the **Logic analyzer setup** panel.
4. Under **Channels**, choose the channels. Under **Acquisition**, set the **Sample rate**, the **Duration** (up to 60 seconds), and, on a Logic Pro, the **Threshold**.
5. Under **Trigger**, keep **Immediate**, or choose **Edge** and set the **Channel** and **Edge**. With an edge trigger, **Duration** becomes **After trigger**, the time captured after the edge.
6. Select **Single** to capture once, or **Run** to capture repeatedly until you select **Stop**.

Each capture's raw transitions open in the waveform view and in **Capture history**. To zoom, pan, or jump to a sample range, see [Navigate the waveform](/docs/debug-mode/logic-analyzer.md#navigate-the-waveform). To decode a bus or save a `.sal` file, ask Inlay.

**Disconnect**, **Rename device**, and **Rescan devices** are in the **⋯** (**Device actions**) menu, with **Forget device** for a saved analyzer that isn't currently detected.

## Decode a bus

Inlay decodes with Logic 2's own protocol analyzers: 1-Wire, Atmel SWI, BiSS-C, CAN, DMX512, HD44780, HDLC, HDMI-CEC, I2C, I2S / PCM, JTAG, LIN, Manchester, MDIO, MIDI, Modbus, PS/2, SMBus, SPI, SWD, Synchronous Parallel, UART (Async Serial), and USB low and full speed.

Provide the channel roles and settings for each bus:

* **UART:** data channel, baud rate, data bits, parity, and stop bits.
* **SPI:** clock and MISO, plus MOSI and chip select when used, and bits per transfer. Clock polarity, phase, and bit order use Logic 2's defaults.
* **I2C:** SDA and SCL. The address display setting changes only how addresses are shown.
* **LIN:** data channel, bit rate, and LIN version.

```text theme={"theme":"css-variables"}
Decode UART on channel 0 at 230400 baud, 8 data bits, no parity, and one
stop bit. Show the decoded bytes and save a CSV alongside the raw capture.
```

Decoded tables show data values in hexadecimal.

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

## Save and inspect

Ask for the files you need:

* A `.sal` capture to reopen in Logic 2.
* Raw digital CSV for the enabled channels.
* A decoded CSV for each analyzer.

When Inlay saves or exports a capture, the waveform and any decoded rows appear in the **Logic** tab. While a capture runs, the tab shows a status message until the analyzer exports the data. To reopen an earlier capture, select **Capture history** in the **Logic** tab.

Keep the raw signals so you can revisit channel assignments and decoder settings. Record the firmware revision, channel map, duration, and reported sample rate with the result.

### In a hardware script

In a [hardware script](/docs/debug-mode/hardware-scripts.md), these helpers are available without an import:

| Step | Helpers |
| - | - |
| Start a capture | `la_start_timed_capture()` or `la_start_manual_capture()` |
| Finish it | `la_wait()` for a timed capture, `la_stop()` for a manual capture |
| Decode | `la_add_protocol_analyzer()` |
| Save and export | `la_save_capture()` for `.sal`, `la_export_raw()` for raw CSV, `la_export_table()` for decoded CSV |

```python theme={"theme":"css-variables"}
capture = la_start_timed_capture(
    duration_seconds=2.0,
    enabled_digital_channels=[0, 1],
    digital_sample_rate=10_000_000,
)
la_wait(capture)
i2c = la_add_protocol_analyzer(capture, "i2c", {"sda": 0, "scl": 1})
la_export_table(capture, i2c, "i2c.csv")
la_save_capture(capture, "boot-i2c.sal")
```

Omit `digital_threshold_volts` on the Original Logic and Logic 8.

## Troubleshoot

* **"No Saleae device detected via USB":** check the cable and USB port, then confirm that Logic 2 shows the analyzer. On Linux, Inlay finds the analyzer with `lsusb`; install your distribution's `usbutils` package if that command is missing.
* **"Saleae Logic 2 is not reachable on port 10430":** open Logic 2, turn on the automation server in **Preferences**, and confirm the port is `10430`.
* **Python or package setup failed:** install Python 3 yourself, then ask Inlay to check the analyzer again.
* **Wrong bytes:** compare housing labels with channel numbers that start at 0, then check framing, SPI mode, channel order, and bit rate.
* **Sample rate changed:** Inlay chose the nearest supported rate. Enable fewer channels for a higher rate.
* **Threshold rejected:** the model has a fixed threshold. Remove the threshold from the request.

See [Logic analyzer](/docs/debug-mode/logic-analyzer.md) to compare instruments.


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