Using the Protocol Decoders: Difference between revisions

From LabNation Wiki
Jump to navigation Jump to search
(Created page with "While examining the digital communication between 2 chips, did you ever find yourself counting rising edges and writing down 0’s and 1’s? This is where protocol decoders c...")
 
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''(You can use Protocol Decoders on both the Analog Graph and/or the Logic Analyzer Graph)'''
While examining the digital communication between 2 chips, did you ever find yourself counting rising edges and writing down 0’s and 1’s? This is where protocol decoders can save you a LOT of time.
While examining the digital communication between 2 chips, did you ever find yourself counting rising edges and writing down 0’s and 1’s? This is where protocol decoders can save you a LOT of time.


Not only do they convert rising edges into digital data for you; if you select the proper decoder, it will also separate messages and present you byte values. This means you can eg convert a clock and data waveform into I2C byte values, as shown in purple in the image below.
Not only do they convert rising edges into digital data for you; if you select the proper decoder, it will also separate messages and present you byte values. This means you can eg convert a clock and data waveform into I2C byte values, as shown in purple in the image below.


If you want to go one step further, you can even feed these bytes into your own decoder in order to translate them into humanly readable words specific to your application! See the screenshot below, where the output of the I2C decoder is converted into higher-level messages by a custom decoder, as shown in the blue blocks below.
If you want to go one step further, you can even feed these bytes into [[Creating your own Protocol Decoder|your own decoder]] in order to translate them into humanly readable words specific to your application! See the screenshot below, where the output of the I2C decoder is converted into higher-level messages by a custom decoder, as shown in the blue blocks below.


<br>[[File:Decoders.png|800px]]  
<br>[[File:Decoders.png|800px]]  
   
   
= Throwing in a decoder =
= Throwing in a decoder =
Whenever you feel the need to have a decoder do the bitpicking for you, start by making sure you have the required input signals nicely aligned on your screen. This basically means you need to see the high and low levels of your digital signal within the boundaries of the main graph.
Whenever you feel the need to have a decoder do the bitpicking for you, start by making sure you have the required input signals nicely aligned on your screen. This means you need to make sure the entire communication is visible.
- While running, the entire communication should be visible in the Viewport (=main graph)
- Preferrably, you'll catch the acquisition using 'Single trigger' mode, as this will allow the SmartScope to fetch the entire acquisition from onboard RAM into the Panorama of the visualizer. Once this has been done, you can get a much more accurate decoding, and you can zoom in to specific portions of interest within a larger communication.


When done, simply slide open the main menu and go to Scope -> Decoders -> Add. The list of currently available decoders will show. Select the decoder you would like to add, as shown in the image below where an I2C decoder is added.
When done, simply slide open the main menu and hit '''Add decoder''', which will bring up a list of currently available decoder. (Keep in mind you can easily create your own decoders, see [Creating your own decoder]). Select the decoder you would like to add, as shown in the image below where an I2C decoder is being added.


<br>[[File:Decoders_selectDecoder.png|800px]]  
<br>[[File:AddDecoder.png]]  
   
   
The decoder wave will be added to the main graph. Since you didn’t yet properly configure its input channels, it will probably report no or bogus data. For now, just slide it vertically to where you like it to reside.
The decoder wave will be added to the main graph, and it context menu will be opened to give you a quick view on its settings (shown in the image below). The SmartScope software contains a feature which will try to automatically map the available input waves to the currect input of the decoder. Finally, just slide it vertically to where you like it to reside.
 
<br>[[File:DecoderAdded.png]]


= Configuring the decoder =
= Configuring the decoder =
All decoders require input waveforms, usually multiple of them. In this step, you’ll let your decoder know which wave to use as which input.
All decoders require input waveforms, usually multiple of them. The SmartScope software contains a feature which will try to automatically map the available input waves to the currect input of the decoder. However, in some cases you might want to manually configure the input waves, or other parameters. In this step, you’ll let your decoder know which waves to use as which input.
As with all GUI elements of the SmartScope, if you want to configure the decoder, simply tap on the decoder. Its context menu will pop up, showing all configurable options.


<br>[[File:Decoders_openContext.png|800px]]
As with all GUI elements of the SmartScope, if you want to configure the decoder, simply tap on the decoder. Its context menu will pop up, showing all configurable options (see image above).
   
   
The first entries define which waves are linked to which input. In this specific case of an I2C decoder, there are 2 required inputs: the clock channel SCL and data channel SDA. For now, ChannelA is being used as input for both, explaining why the decoding is failing in the background of the image above.
The first entries define which waves are linked to which input. In this specific case of an I2C decoder, there are 2 required inputs: the clock channel SCL and data channel SDA. In case you want to change which wave is being used as input, simply tap on that input, and a list of valid input candidates is shown. In the example below, SCL is tapped, bringing up a list of all possible input wave candidates. For digital inputs, such as SCL in our case, you can choose from all digital and analog waves. This is the reason why the following images was made in Mixed Mode: notice that you can use ChannelA as possible input channel for SCL, even though your I2C Decoder is on your digital graph.
Simply tap on one of the inputs, and a list of valid input candidates is shown. In this specific example, SCL is set correctly, but SDA should be linked to ChannelB. Hence, tap on SDA and select B from the list, as shown below.
   
   
<br>[[File:Decoders_selectInput.png|800px]]
<br>[[File:DecoderInputWaves.png]]


Now when the next wave is being captured, it should be decoded correctly as shown in the image below!
Whenever you change an input channel of a decoder, the decoder will re-process any data immediately, also when the acquisition has been stopped. This allows you to acquire a dataset, and get immediately feedback while fine-tuning your decoder settings.
<br>[[File:Decoders_done.png|800px]]


= Changing the radix of the decoder =
= Changing the radix of the decoder =
By default, decoder output values are shown in hexadecimal. Since not all of us are robots, it might be desirable to change this to decimal values. In order to do so, simply tap the decoder indicator on the left, select the radix icon (second to the right), and select the radix of your preference!
By default, decoder output values are shown in hexadecimal. Since not all of us are robots, it might be desirable to change this to decimal values or even other representations. In order to do so, simply tap the decoder indicator on the left, select the radix icon (second to the right), and select the radix of your preference! Currently supported radices include Hex, Decimal, Binary (shown below) and ASCII which will convert the byte value into its ASCII character.


<br>[[File:Decoders_radix.png|800px]]
<br>[[File:DecoderRadix.png]]
   
   
= Removing a decoder =
= Removing a decoder =
If you want to switch back to manual bitpicking, simply tap the decoder indicator on the left, and select the right-most icon.
If you want to switch back to manual bitpicking, simply tap the decoder indicator on the left, and select the thrashcan.


<br>[[File:Decoders_hide.png|800px]]
<br>[[File:Decoders_hide.png|800px]]
= Decoding while running or when stopped =
While the acquisition is running, the decoding is happening on-the-fly on the data is it is coming in. However, in this mode the decoders only have access to the data shown on the screen. Basically, if you cannot see all edges separately in the Viewport (the main graph), you cannot expect the decoders to decode on-the-fly.
Therefore, if you're not zoomed in enough, correct decoding will not be possible. If this is the case, you can stop the acquisition, after which each and every sample inside the RAM will be transfered to the software, allowing the decoders to do their processing in fine detail.
= Save all decoded data to file =
Visualizing the decoded data is nice, but in some cases you're really interested in the decoded data itself. To do so, open up the Context menu of the Decoder and tap the right-most icon 'Save'. This will store all decoded data in CSV format, including the start- and stop sample of each block, the type of each block and its value.
<br>[[File:DecoderSave.png]]
= Create a custom Protocol decoder =
See the [[Creating your own Protocol Decoder|Custom Protocol Decoder]] article.

Latest revision as of 09:54, 16 December 2015

(You can use Protocol Decoders on both the Analog Graph and/or the Logic Analyzer Graph)

While examining the digital communication between 2 chips, did you ever find yourself counting rising edges and writing down 0’s and 1’s? This is where protocol decoders can save you a LOT of time.

Not only do they convert rising edges into digital data for you; if you select the proper decoder, it will also separate messages and present you byte values. This means you can eg convert a clock and data waveform into I2C byte values, as shown in purple in the image below.

If you want to go one step further, you can even feed these bytes into your own decoder in order to translate them into humanly readable words specific to your application! See the screenshot below, where the output of the I2C decoder is converted into higher-level messages by a custom decoder, as shown in the blue blocks below.


Decoders.png

Throwing in a decoder

Whenever you feel the need to have a decoder do the bitpicking for you, start by making sure you have the required input signals nicely aligned on your screen. This means you need to make sure the entire communication is visible. - While running, the entire communication should be visible in the Viewport (=main graph) - Preferrably, you'll catch the acquisition using 'Single trigger' mode, as this will allow the SmartScope to fetch the entire acquisition from onboard RAM into the Panorama of the visualizer. Once this has been done, you can get a much more accurate decoding, and you can zoom in to specific portions of interest within a larger communication.

When done, simply slide open the main menu and hit Add decoder, which will bring up a list of currently available decoder. (Keep in mind you can easily create your own decoders, see [Creating your own decoder]). Select the decoder you would like to add, as shown in the image below where an I2C decoder is being added.


AddDecoder.png

The decoder wave will be added to the main graph, and it context menu will be opened to give you a quick view on its settings (shown in the image below). The SmartScope software contains a feature which will try to automatically map the available input waves to the currect input of the decoder. Finally, just slide it vertically to where you like it to reside.


DecoderAdded.png

Configuring the decoder

All decoders require input waveforms, usually multiple of them. The SmartScope software contains a feature which will try to automatically map the available input waves to the currect input of the decoder. However, in some cases you might want to manually configure the input waves, or other parameters. In this step, you’ll let your decoder know which waves to use as which input.

As with all GUI elements of the SmartScope, if you want to configure the decoder, simply tap on the decoder. Its context menu will pop up, showing all configurable options (see image above).

The first entries define which waves are linked to which input. In this specific case of an I2C decoder, there are 2 required inputs: the clock channel SCL and data channel SDA. In case you want to change which wave is being used as input, simply tap on that input, and a list of valid input candidates is shown. In the example below, SCL is tapped, bringing up a list of all possible input wave candidates. For digital inputs, such as SCL in our case, you can choose from all digital and analog waves. This is the reason why the following images was made in Mixed Mode: notice that you can use ChannelA as possible input channel for SCL, even though your I2C Decoder is on your digital graph.


DecoderInputWaves.png

Whenever you change an input channel of a decoder, the decoder will re-process any data immediately, also when the acquisition has been stopped. This allows you to acquire a dataset, and get immediately feedback while fine-tuning your decoder settings.

Changing the radix of the decoder

By default, decoder output values are shown in hexadecimal. Since not all of us are robots, it might be desirable to change this to decimal values or even other representations. In order to do so, simply tap the decoder indicator on the left, select the radix icon (second to the right), and select the radix of your preference! Currently supported radices include Hex, Decimal, Binary (shown below) and ASCII which will convert the byte value into its ASCII character.


DecoderRadix.png

Removing a decoder

If you want to switch back to manual bitpicking, simply tap the decoder indicator on the left, and select the thrashcan.


Decoders hide.png

Decoding while running or when stopped

While the acquisition is running, the decoding is happening on-the-fly on the data is it is coming in. However, in this mode the decoders only have access to the data shown on the screen. Basically, if you cannot see all edges separately in the Viewport (the main graph), you cannot expect the decoders to decode on-the-fly.

Therefore, if you're not zoomed in enough, correct decoding will not be possible. If this is the case, you can stop the acquisition, after which each and every sample inside the RAM will be transfered to the software, allowing the decoders to do their processing in fine detail.

Save all decoded data to file

Visualizing the decoded data is nice, but in some cases you're really interested in the decoded data itself. To do so, open up the Context menu of the Decoder and tap the right-most icon 'Save'. This will store all decoded data in CSV format, including the start- and stop sample of each block, the type of each block and its value.


DecoderSave.png

Create a custom Protocol decoder

See the Custom Protocol Decoder article.