Protocol decoder:ook_vis

From sigrok
Revision as of 13:49, 13 October 2018 by Uwe Hermann (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
ook_vis
Ook vis.png
Name OOK visualisation
Description OOK visualisation in various formats
Status supported
License GPLv2+
Source code decoders/ook_vis
Input ook
Output ook
Probes
Optional probes
Options displayas, synclen, syncoffset, refsample

The ook_vis protocol decoder takes ook input from the ook decoder and displays it in a variety of formats.

It is provided to help analyse unknown format waveforms. Using the ook decoder with this one allows you to try NRZ, Manchester and Differential Manchester and their possible settings to see what produces the lowest errors. Then use ook_vis to format the results in a suitable fashion for what you are decoding, make some structure assumptions and see what that does to the results.

The ook_vis protocol decoder provides two annotation row. The first row does a basic decode (with formatting) while the second attempts to work out where the preamble and sync might be and then displays the data with a posible structure. The sync position is worked out from the preamble and detects when it switches from '1111' or '1010' to something else.

Decoder

The ook_vis decoder has four options:

  • The displayas option allows the user to pick how the data is presented. It supports two lengths 4 bits (nibble) and 8 bits (byte). It also allows numbers to be displayed as hexadecimal or binary coded decimal (BCD) and also supports bit reversal.
  • The synclen option allows the user to set the length of the sync and vary it to see what that does to the data after it.
  • The syncoffset option allows the user to move the start of sync backwards and forwards to see what that does to the data after it.
  • The refsample option allows one of the packets to be used as a reference sample which all the packets are compared against. To use this feature first select show numbers to identify which packet to use, then select the packet number from 1 - 30. To turn it off again select off.

You can show the available options with the --show command:

$ sigrok-cli -P ook_vis --show

sigrok-cli examples

The ook_vis decoder concentrates on the protocol and not how it is transmitted so it needs the ook decoder to deal with the encoding before it can do its work. It stacks on top of the ook decoder.

To decode a Manchester (default) encoded trace and then pass the result to the ook_vis decoder for display as reversed hex nibbles and only display the ook_vis output. The trace belongs to a real Oregon v3 rain sensor model PCR800.

$ sigrok-cli -P ook:data=D0,ook_vis:displayas='Nibble - Hex rev' -i oregon_pcr800.sr -A ook_vis