Skip to main content
The Logic Analyzer records the values of digital signals in your project. It’s a powerful debugging tool, and can help you diagnose issues in your circuit and code. It’s also very useful as a learning aid.

Use cases

Some use cases include: Logic Analyzer: I2C protocol signals decoded in PulseView

Features

The Wokwi Logic Analyzer has 8 digital channels, called D0 to D7. It has a sample rate of 1GHz, which should be more than enough for most applications.
  • Each channel has an activity LED that turns green whenever there is activity on the channel
  • The activity LEDs provide an easy way to see that the signals are connected correctly
  • The logic analyzer has a small display showing the number of samples captured since the simulation started
  • The configurable trigger lets you record just part of the data

Using the Logic Analyzer

1

Add the Logic Analyzer

Click the blue Plus button, then select “Logic Analyzer (8 channels)”.
2

Connect signals

Connect the signals you want to record to the Logic Analyzer pins. For instance, if you want to record I2C communication between an Arduino Uno and a peripheral, connect pins A4/A5 (SDA/SCL) to pins D0/D1 of the Logic Analyzer.
3

Start simulation

Start the simulation. You should see the green activity LEDs blink as the signals are coming in, and the number of samples should go up.
4

Download capture

Stop the simulation. This will download a file called “wokwi-logic.vcd” to your computer in Value Change Dump format.
5

View the capture

Use software such as PulseView or GTKWave to open and view the capture files.

Exporting VCD in VS Code

When using Wokwi for VS Code, the VCD file is automatically saved when the simulation stops, provided your diagram includes a Logic Analyzer. By default, the file is saved as wokwi.vcd in your project root. You can customize the output path by adding the vcdFile option to your wokwi.toml file:
[wokwi]
version = 1
firmware = 'your-firmware.hex'
vcdFile = 'logic-capture.vcd'

Using the Trigger

By default, the logic analyzer records data for the entire duration of the simulation. The trigger allows you to control the recording of data, by setting the value of one of the digital analyzer’s input pins (D7 by default). Here are some examples for common use cases:
Use the triggerPin and triggerLevel attributes to configure the trigger pin and set the trigger level (“high” or “low”). Check out the wokwi-logic-analyzer documentation for more information.

Customizing the Channel Names

By default, the channel names are D0, D1, D2, etc. You can customize the channel names by setting the channelNames attribute. For example, to name the channels “SCL”, “SDA”, “RST”, add the following attribute to the logic analyzer:
{ 
  "type": "wokwi-logic-analyzer", 
  "id": "logic1",
  "attrs": {
    "channelNames": "SCL,SDA,RST"
  }
}
The channel names only affect the VCD file output. The input pins of the logic analyzer are called D0, D1, etc., regardless of the channelNames attribute.

Viewing the data in PulseView

PulseView is an open source Logic Analyzer GUI. It runs on Linux, Windows, Mac OS X, and there’s even an Android version. You can visit their downloads page to get the latest version.
For ARM Mac (M1/M2) users, please follow the PulseView on Mac M1/M2 guide.
1

Import VCD file

Load the recorded signal (VCD) file by clicking on the small arrow next to the “Open” button, and choosing: “Import Value Change Dump data…”PulseView: Import Value Change Dump data
2

Configure import options

You’ll see a dialog where you can choose the VCD file to import. Once you selected a file, there’ll be another dialog with import options.PulseView: Compress idle periods
3

Set downsampling factor

Set the Downsampling factor to reduce memory usage. A value of 50 should work for most use cases.
The default options usually cause PulseView to consume a lot of RAM and become sluggish. Setting the downsampling factor helps prevent this.
The following table lists some common downsampling values:
Downsampling factorSample rateWhen to use?
10001MHzLow frequency signals / long recordings (10+ minutes)
5020MHzCommon signals (UART, I2C, LED PWM, WS2812, etc.)
10100MHzHigh speed signals (10MHz+)
11GHzVery high speed signals (50MHz+)
After confirming the import options, you should see the imported signals on the screen. The signal names will be “logic.D0”, “logic.D1”, etc.

PulseView User Manual

Learn more about using PulseView

Configuring Windows to open VCD files in PulseView

You can configure Windows to automatically open VCD files in PulseView. Open a command prompt (cmd) window as administrator, and type the following commands:
ftype vcdfile="%ProgramFiles%\sigrok\PulseView\pulseview.exe" "-I" "vcd:downsample=50" "%1"
assoc .vcd=vcdfile
These commands don’t work in powershell. They only work in cmd with Administrator privileges. The command sets the Downsampling factor to 50, but you can choose a different value that fits your needs.

Viewing the data in GTKWave

GTKWave is an open source, cross-platform wave viewer software. GTKWave can open VCD files generated by the Wokwi Logic Analyzer.

wokwi2gtkwave Python Script

Automate GTKWave usage with Wokwi - monitor downloads and auto-display signals
The wokwi2gtkwave Python script is a user-contributed automation project for using GTKWave with Wokwi: it can monitor your downloads directory and automatically open new files with GTKWave. The script also configures GTKWave to automatically display the signals from your VCD files and zoom them to fit your screen.

Build docs developers (and LLMs) love