Sniffer  0.1.1
Loading...
Searching...
No Matches
Getting Started

In this guide, we will look at how to get the Sniffer up and running. This includes flashing the sigrok-pico firmware onto a Raspberry Pi Pico (or Pico2), installing PulseView including the necessary DCC decoder, and finally capturing a DCC trace.

Prerequisites

Before we can get started, however, we need one thing above all: the Sniffer board. Due to the presumably small number of units, I unfortunately cannot provide the Sniffer pre-assembled. Instead, the PCB must be manufactured by a PCB prototyping service such as PCBWay. However, the board is only two layers and should therefore be very inexpensive.

Besides the PCB itself, we also need the components. Care was taken to use large footprints to allow for manual soldering. The required components can be found either in the BOM (.xlsx) or this shared DigiKey list.

At the time of writing, the component costs amount to approximately €16.

Flash sigrok-pico

Once the PCB is soldered, the appropriate firmware from the sigrok-pico project must be flashed onto the Pico (or Pico2). Depending on the model, you will need one of the following firmware versions.

Fortunately, a connected Pico registers as a mass storage device on the PC, and the firmware can therefore be easily dragged and dropped onto the appearing drive. No need for installers whatsoever.

Install PulseView

Next, we will install PulseView, an GPL3 licensed logic analyzer software from the company Sigrok. Unfortunately, PulseView releases very infrequently, which is why we must install the continuous nightly build. The last stable version 0.4.2 is so old that it doesn't yet include the necessary drivers...

Here are the links to the AppImage or installer.

Add DCC Decoder

Last but not least, we also need the DCC decoder, which the company ZIMO kindly provides as an open source. An attempt has also been made to upstream this decoder, but whether it will ever end up in the official repository remains to be seen.

Here is the link to the fork containing the DCC decoder.
https://github.com/ZIMO-Elektronik/libsigrokdecode/tree/dcc

The folder /decoders/dcc of this repository must be copied to the following user folder so that it is visible to PulseView.

  • Linux
    ~/.local/share/libsigrokdecode/decoders
  • Windows
    C:\Users\YourUsername\AppData\Local\libsigrokdecode\decoders

For simplicity, the following script can also be copied and executed. It creates the folder and downloads the necessary files.

  • Linux
    mkdir -p ~/.local/share/libsigrokdecode/decoders/dcc
    cd ~/.local/share/libsigrokdecode/decoders/dcc
    curl -L -o __init__.py https://github.com/ZIMO-Elektronik/libsigrokdecode/raw/dcc/decoders/dcc/__init__.py
    curl -L -o lists.py https://github.com/ZIMO-Elektronik/libsigrokdecode/raw/dcc/decoders/dcc/lists.py
    curl -L -o pd.py https://github.com/ZIMO-Elektronik/libsigrokdecode/raw/dcc/decoders/dcc/pd.py
  • Windows
    mkdir "$env:LOCALAPPDATA\libsigrokdecode\decoders\dcc"
    cd "$env:LOCALAPPDATA\libsigrokdecode\decoders\dcc"
    curl.exe -L -o __init__.py "https://github.com/ZIMO-Elektronik/libsigrokdecode/raw/dcc/decoders/dcc/__init__.py"
    curl.exe -L -o lists.py "https://github.com/ZIMO-Elektronik/libsigrokdecode/raw/dcc/decoders/dcc/lists.py"
    curl.exe -L -o pd.py "https://github.com/ZIMO-Elektronik/libsigrokdecode/raw/dcc/decoders/dcc/pd.py"

Capture a Trace

Once we have a working board and installation, we can start capturing a trace. So we plug in the board (I assume the cabling is self-explanatory) and start PulseView.

Connect to Device

Click the device selection drop down and chose the RaspberryPI PICO (raspberrypi-pico) driver. Select Serial Port as interface and pick the port. The naming should help in selecting the right one (/dev/ttyACM0 (Pico - F020035836D7A1C3) in my case). Afterwards click Scan for devices using driver above and your Sniffer board should appear in the frame below. Select it and click OK to close the window.

Configure Channels

Click the  red probe icon to open the configuration window for the channels. Enable the channels from the following table. Optionally, you can also rename the channels to their DCC names; they will then be automatically assigned when selecting the decoder.

PulseView DCC
D2 NC
D3 NC
D4 P
D5 N
D6 BIDI
Warning
Please note that channels D2 and D3 must remain enabled even when not in use. This is a limitation of the sigrok-pico firmware, which was intentionally accepted to support the LogicAnalyzer firmware as an alternative. LogicAnalyzer uses these two pins (GPIO0 and GPIO1 on the Pico) as optional triggers.

Select the number of samples to be recorded and then increase the sample rate to at least 1MHz. Anything below that will result in an error message.

Note
When you hover your mouse cursor over one of the settings, the total sampling time will be displayed.

Now click  Run and you should see samples getting captured.

Add Protocol Decoder

Now the DCC decoder needs to be loaded. To do this, click the   yellow/green pulse icon and search for DCC. Unless the channel names have been changed, the channels must now be manually assigned to their signals.

Note
If you running on a toaster, processing the samples can take quite a long time. After all, the decoder is Python 🐍.

tl;dr

Capturing a trace

Previous Next
Introduction HW Reference