Prepare
- Connect the device with a data-capable USB cable.
- Close the WaveForms application and any other program using the device.
- Ask Embedder to check the device. The first time, approve the setup prompts:
- Install Python 3? if Python is missing.
- Install managed Digilent WaveForms runtime? if WaveForms isn’t installed. The prompt shows where Embedder will install it. Embedder can install the runtime on macOS, Linux (x64 and Arm64), and Windows x64.
- Create Embedder Python environment? and the Python package install that follows.
- Ask Embedder to list the selected device’s digital inputs, analog inputs, waveform outputs, and supplies before you use them.
/Applications when it finds one. If Python 3 is already installed and a Digilent device is connected when Embedder starts, Embedder may set up the runtime in the background, so you might not see every prompt.
Channel numbers
Embedder counts channels from 0. On the AD3, digital channels are 0 to 15. Analog input 0 is the physical Channel 1, and analog input 1 is Channel 2. When several Digilent devices are connected, give Embedder the serial number of the one to use.Capture digital traffic
Stop a manual capture before decoding or saving it. The AD3 uses a fixed digital threshold.
Add a trigger
Without a trigger, the capture starts immediately. To start on an event, describe one of these:la_setup_trigger() before you start the capture. Use the reported sample rate when you measure timing.
Capture from the Monitor
You can also capture digital channels from the Monitor’s Logic tab without asking Embedder.- In the Monitor, select +, then select the device under On the bench. Or open Logic Analyzer under Views and choose the device from the device chip.
- If the toolbar shows Set up & connect or Connect, select it. Selecting Set up & connect approves setup.
- Select the Logic setup chip, the settings summary next to the device chip, to open the Logic analyzer setup panel.
- Under Channels, choose the channels. Under Acquisition, set the Sample rate, the Duration (up to 60 seconds), and, on a Digital Discovery, the Threshold. If the tab reports that the capture exceeds the analyzer’s buffer, lower the sample rate or the duration.
- 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.
- Select Single to capture once, or Run to capture repeatedly until you select Stop.
Decode and save
Embedder decodes Digilent captures with these built-in decoders:
The SPI decoder samples on the rising clock edge, most significant bit first, with an active-low chip select. For other SPI modes, use a DSLogic or decode the raw CSV.
Ask for the files you need, then inspect the signals and frames in the Logic tab:
- Raw digital CSV, one column per channel.
- A decoded CSV for each decoder, with data in hexadecimal.
- A saved capture as
.dwf3.json. This is Embedder’s Digilent capture format; Logic 2 can’t open it.
la_add_protocol_analyzer(), la_export_raw(), la_export_table(), and la_save_capture().
CAN decoding shows frames. To interpret application-level signals with your project’s database, use CAN Monitor.
Measure analog signals
range_volts=5.0 asks for a window of at least ±5 V; Embedder picks the smallest device range that covers it. Check the returned rate and duration before you calculate timing.
Generate a stimulus
Describe the output, waveform, frequency, amplitude, offset, and what happens when the test ends:
Support for each waveform depends on the device. Amplitude is the peak value, so a 1 V amplitude swings 2 V peak to peak before offset. Amplitude can be up to 5 V and offset from -5 V to 5 V.
In a script,
la_wavegen_setup() configures an output, and la_wavegen_start() and la_wavegen_stop() control it. la_wavegen_dc() starts a DC level, and la_wavegen_pulse() starts a square wave with the duty cycle you choose, each in one call.
Put the stimulus, capture, and cleanup in one script. State the permitted voltage range and the final output state, and stop the output even if the capture fails.
Control a supply
On a device with adjustable supplies, specify the rail and voltage. The AD3 has a positive rail from 0 to +5 V and a negative rail from 0 to -5 V. Ask for an explicit shutdown state. You can read the supply status once or monitor it for a set time:la_psu_setup() sets the rails and the master enable, la_psu_status() reads them once, and la_psu_monitor() records them to the Power tab for a set time. Pass 0 for a rail to turn it off.
These readings come from the device’s own supply monitor. For an inline current measurement of the target, use a PPK2 or Joulescope.
Troubleshoot
- “No Digilent device detected”: check the USB cable and port, then connect an Analog Discovery or Digital Discovery and retry. On Linux, Embedder finds the device with
lsusb; install your distribution’susbutilspackage if that command is missing. - “Managed Digilent WaveForms runtime is not available for host …”: Embedder can’t install the runtime on this operating system or processor. Install WaveForms from Digilent, then ask Embedder to check the device again.
- “Connected Digilent devices do not expose a logic-analyzer instrument”: Embedder can’t use this model. Connect a device with digital inputs.
- Instrument missing: the selected model doesn’t provide that instrument, such as analog inputs on a Digital Discovery.
- Device busy: close WaveForms or another script using the device.
- Clipped analog signal: increase
range_voltsor reduce the stimulus amplitude. - Wrong channel: compare script indexes, which start at 0, with the physical labels.
- Analog recording isn’t in the Logic tab: this is expected. Digilent analog recordings open in Oscilloscope, and supply readings in Power.