Protocol decoder

Protocol decoding is probably the most wanted feature in logic analyzers. Protocol decoding is the (automatic) process of analyzing the logic signals and interpreting them according to a specific protocol. For example, the image below shows I2C signals signals with an additional layer of decoding:

I2C signals decoded by a logic analyzer

In the past, to verify if a protocol was correctly working, one would look at the signals with an oscilloscope, manually interpret bits and bytes, and write them down on a piece of paper. Luckily, those times are over!

Knowing how protocol decoding is important to the user, we (Ikalogic) have put a great deal of effort into allowing protocol decoders to report as much information as possible. For example, the CAN bus frame below has a wrong CRC, and the decoder highlights this CRC error and even displays what should the CRC be, according to the latest CAN standards.

CAN frame with CRC error

Similarly, it will clearly show if decoded packets are correctly constructed. For instance, the diagram below shows a LIN message frame with a correct checksum value:

LIN good CRC

This implies that ScanaStudio decoders can calculate the CRC or Checksum of a frame and compare it against the one captured in the frame. Please note that each protocol is different, and so is the data interpreted and presented. For instance, not all protocols specify error checking and data integrity verification like CAN and LIN bus.

How (and when) to add a protocol decoder?

To add a protocol to the workspace, simply go to the “Protocols” tab and click “Add new” as shown in the image below:

Add a new protocol decoder (analyzers)

Then follow the instructions to configure the decoder. Please note that every protocol is different, and so is its configuration, but it will at least imply selecting the channel(s) to be decoded. Depending on the complexity of a decoder’s user interface, one may read additional documentation by clicking on the “Help” button:

Protocol decoder help button

But the most important question is when to add a protocol decoder when apprehending a new system that needs to be diagnosed, debugged, or simply analyzed. In an ideal world, one would start by adding a protocol to a workspace, configure it down to the smallest detail, then start a capture and voila, data would appear perfectly decoded on the screen! While this scenario may happen sometimes, things don’t always go that smoothly.

We recommend first starting by capturing signals, without worrying about the signal decoding part. Your “human” eye analysis of the signals, their frequency, shape and periodicity can already give you some insights:

  • You may recognize that some channels are not correctly connected or missing
  • You may see that the voltage levels need some adjustments
  • You may also notice that the interesting part of the signal happens only once every few seconds, so it would be a good idea to add a simple trigger.

At this point, you should already have enough information to add and configure a protocol to your workspace.

Managing the list of supported protocols

A note about the scripts ecosystem

In ScanaStudio, protocol decoders (analyzers) are part of the “Scripts ecosystem”. ScanaStudio relies on scripts to add various features to the software, among which, the protocol decoding. Each protocol is supported via a script that covers one or more feature like:

  • Signal decoding
  • Trigger sequence generator (allowing your compatible logic analyzer to trigger on a specific protocol feature)
  • Signal builder and pattern generator (allowing a generator-capable logic analyzer to generate specific packets for a protocol)

Scripts are open-source and highly collaborative. Ikalogic remains the main contributor to the ScanaStudio scripts, always ensuring scripts meet our standards, but we couldn’t get to where we are without the input of many active users who suggested fixes, updates and new features. Some scripts are written from the ground up by other third-party users and shared back to the whole community. If you’re interested in adding your own features to ScanaStudio to automate some analysis processes, you can get started here:

Updating decoders and/or getting new ones

At any moment, you can launch the script manager from ScanaStudio by clicking on the settings menu (top right corner) and then “Scripts manager”.

script list

This window lets you download any new scripts that may have been added online, or update existing scripts. Scripts that have the “D” icon in the capability column are scripts that can decode signals.

Getting the most out of a decoder

Don’t hesitate to look through the configuration options that are specific to each protocol decoder. Most decoders can be configured to display the data in various formats (HEX, ASCII, Binary, etc). Some even allow you to choose different formats for different kinds of fields. For instance, the I2C protocol analyzer lets you select a different display format for both the data and address fields:

I2C protocol decoder display options

Which can produce this result:

I2C packets analyzed