Introduction

Increasingly, microcontrollers and engine control units (ECUs) utilize a wide array of serial-data protocols to collect data from sensors to govern the operation of motors, fans, HVAC, lighting, and other functions in automotive, industrial, commercial, medical, and consumer electronics. Teledyne LeCroy’s WaveSurfer oscilloscopes can be equipped with software options allowing you to trigger on and decode serial data streams, most focused on protocols used in automotive and embedded control systems.1 In this Application Note, we will show how easy it is to trigger on a particular type of frame in a CAN FD stream, then decode the data within those frames.

The examples shown here were taken on a WaveSurfer 4000HD, although the functionality is the same on WaveSurfer 3000z. Step-by-step procedures for using all these features can be found in the various Serial Trigger and Decode manuals at teledynelecroy.com/support/techlib/.

Acquiring the Serial-Data Signal

Some serial-data protocols, such as I2C, use clock and data lines to transmit data; others, such as CAN (Controller Area Network) are not clocked signals but rather are differential in nature. If you are probing a differential signal single-ended, use the oscilloscope’s math capability to subtract one channel from the other and display the differential content. The resulting math function trace (Fn) will be your signal source for triggering and decoding.

Triggering on Serial Data

Serial triggers allow you to trigger the oscilloscope on a specific occurrence within a serial data stream, such as a packet ID, command code, data value, protocol error and so on. The trigger selections will be relevant to the structure of the protocol.

Following the installation of a serial trigger option, the oscilloscope’s Trigger setup dialog will have a selection for Serial. After selecting Serial, choose the protocol used, then use the Serial Trigger dialog to define the trigger criteria.

Figure 1: Use the protocol-specific Serial Trigger dialog to set the criteria for triggering on a serial-data stream.

In Figure 1, the oscilloscope has been configured to trigger on all instances of Frame ID equal to 145, but a number of other conditions could have been set that would have enabled multiples values (e.g., all within/without a given range) to satisfy the trigger criteria.

It is not required to use a serial trigger to acquire the data used for a serial decoding; any encoded signal can be acquired using any type of trigger and decoded. However, especially when used with sequence sampling mode, the serial trigger is a powerful way to target only specific communications within the bus, lessening the volume of data to be processed by the decoder and visually inspected by the user.

Decoding Serial Data

Once the signal has been acquired, to invoke the decoder, choose Analysis > Serial Decode from the oscilloscope menu bar. On the Decode Setup dialog, select the data source to be decoded and the protocol to use (Figure 2).

Figure 2: Within the Decode Setup dialog, just select the Source of the data and the Protocol to be decoded.

With the Source and Protocol set, checking the View Decode box on the Decode Setup dialog should quickly produce a decoding of the signal. A color-coded overlay appears on the source waveform, with the decoded values marked on it and listed in a decoder results table. Each row of the results table is one record, usually corresponding to a single frame, message or packet (depending on the protocol and how you have chosen to "packetized" the decoding).

The results table is interactive; touching any given row will create a zoom of that entire record, scaled to fit the 10 division width of the screen.

Figure 3: Touching a row in the Decode Results table opens a zoom of the corresponding packet with a color-coded overlay setting off and identifying the packet’s constituent parts.

Touch the new Zoom descriptor box to open the Zn dialog and further rescale the zoom until you’ve achieved the desired level of detail.

Searching and Filtering Decoded Serial Data

You can use the Search controls at the right of the Zoom dialog to search for a the next (or previous) match to a specific ID or data value.

Figure 4: Apply Search tools on the Zoom dialog to find the next matching serial-data message.

Another means of finding specific data is to filter a column of the decode result table. As shown in Figure 5, any column of the result table with the ⮟ symbol in it can be used to filter the records using a Boolean search set on those values. Touch the ⮟ to set the filter criteria.

Figure 5: Applying conditional filters to the Decode Results table limits the display to only records meeting the filter criteria.

Conclusion

WaveSurfer oscilloscopes offer powerful tools for working with serial-data streams in a many industry-standard protocols. These tools make debug and validation of serial-data traffic in embedded systems quick and painless.