Main Content

Inspect and Measure Transitions Using the Logic Analyzer

In this tutorial, you explore key functionality of the Logic Analyzer, such as choosing and configuring signals to visualize, stepping through a simulation, and measuring transitions.

Open a Simulink Model

To follow along with this tutorial, open the dspsdadc_fixpt model in the Sigma-Delta A/D Conversion example.

Sigma-Delta A/D Conversion model diagram

Open the Logic Analyzer

From the Simulink® toolstrip, on the Simulation tab, in the Review Results gallery, click the Logic Analyzer button .

The Logic Analyzer opens with the selected signals shown in the channel display.

Logic analyzer window

Configure Global Settings and Visual Layout

  1. Click Settings. Set the Height to 20 and the Spacing to 10, and then click OK.

  2. From the Logic Analyzer toolstrip, click Add Divider. A divider named Divider is added to the bottom of your channels. You can use dividers to separate signals.

  3. Double-click Divider and rename Divider as Analog Input Calculation. Drag the divider to the top of the channels pane.

  4. Add another divider and name it Error Calculation.

  5. From the Logic Analyzer toolstrip, click Add Group. A group named Group1 is added to the bottom of your channels. You can use groups to group signals in a collapsible tree structure. Double-click Group1 and rename it as Digital Approximation Calculation.

  6. You can visualize the same signal in multiple places. Right-click the Analog Input(Delayed) signal and select Copy. Paste this signal under the Error Calculation divider. Repeat the process for the CIC Digitized Approximation signal. Organize your dividers and signals as shown in the screen shot, and then collapse the Digital Approximation Calculation group.

Signal names in the Logic Analyzer, organized as described.

Set Stepping Options

  1. From the Logic Analyzer toolstrip, click Stepping Options.

  2. Select the Enable stepping back option. Specify the Maximum number of saved back steps as 2 and the Interval between stored back steps as 100 steps. When you run the simulation, a snapshot of the model is taken every 100 steps. Only the last snapshot is saved.

  3. Set Move back/forward by to 100 steps.

  4. Select the Pause simulation when time reaches option. Specify the simulation to pause after 0.2 seconds of model time has elapsed, and then click OK.

Run Model

  1. To run the model, click Run on the Logic Analyzer toolstrip. The model runs for 0.2 seconds of model time and then pauses.

  2. Click to fit your data to the time range.

    Logic analyzer window with signals plotted

Configure Individual Wave Settings

  1. Select all waves under your Analog Input Calculation divider. Then on the Waves tab, select a new Wave Color for the selected waves.

  2. Under the Error Calculation divider, select the Analog Input(Delayed) and CIC Digitized Approximation waves. On the Waves tab, modify the Format to Digital. The selected waves are now displayed as digital transitions.

Inspect and Measure Transitions

  1. On the Logic Analyzer toolstrip, click and then drag-and-drop start and end points to zoom in time.

    Zoom in on a transition measurement in the Logic analyzer window

  2. For waves displayed as digital, you can use the Next Transition and Previous Transition buttons. To move the active cursor to the next transition, click Next Transition.

  3. Click Lock to lock the active cursor in place.

  4. Click Add Cursor to add another cursor to the axes. The cursor shows its current position in time, and the difference from all surrounding cursors in time.

    Logic analyzer window with two cursors

  5. Right-click the second cursor you added and select Delete Cursor.

  6. Press the space bar to zoom out.

  7. Add another cursor and line it up with a low point of the Analog Input wave in your Analog Input Calculation division. Use the value displayed in the wave value pane to fine-tune the cursor position in time.

  8. Add another cursor and line it up with the corresponding low point of the Analog Input(Delayed) wave in your Analog Input Calculation division.

    Logic analyzer window with three cursors

Step Through Simulation

  1. To move the simulation forward 100 steps, click Step Forward. The time axis adjusts so that you can see the most recent data.

  2. To move the simulation backward 100 steps, click Step Back. The Step Back button becomes disabled because you specified saving only two back step.

Save Logic Analyzer Settings

When you save your model, the logic analyzer settings are also saved for that model.

See Also

|