2.3 Using the Simulator Logic Analyzer

The simulator logic analyzer allows you to graphically view digital signals over a defined time period. Open the logic analyzer window from Window>Simulator>Logic Analyzer.

Figure 2-3. Logic Analyzer Window with Data

Logic Analyzer Setup

Either pin or bus (containing one or more pins) data over time may be displayed in the window. Click on the Settings button to open the Settings dialog where you can select pins or buses. Hover the mouse over a button to see its definition.

Settings

To select pins:

  1. Click the “Add/Delete Pins” tab.
  2. Use the right and left arrow icons to add (choose) or delete (remove) pin(s). Hover the mouse over a button to see its definition.
  3. Use the up and down icons to select the display order of the pins in the window.
  4. Click OK to add the pin(s) to the Logic Analyzer window.
Figure 2-4. Add/Delete Pins Tab

To select buses:

  1. Click the “Add/Delete Bus” tab.
  2. In the “Add New Bus” text box, enter a name for a new bus.
  3. Click the “Add New Bus” icon next to the text box. The new bus name will move under “Bus(es)” and a list of available pins will appear under “Available Pins”.
  4. Use the right and left arrow icons to add (choose) or delete (remove) pin(s). Hover the mouse over a button to see its definition.
  5. Use the up and down icons to select the order of the pins in the bus. Pins should be in order of least significant bit (lsb) to most significant bit (msb). The pin values will be combined based on this.
 Example:
    RA0 (lsb) RA1 (msb) Data Value
    0 0 0
    1 0 1
    0 1 2
    1 1 3
  6. Click OK to add the bus(es) to the Logic Analyzer window.

To add more buses, repeat the steps above. Up and down arrow icons to the right of the “Bus(es)” text box may be used to select the display order of the buses in the window. A “Delete Bus” icon is also available.

Figure 2-5. Add/Delete Bus Tab

To set window properties (including color):

  1. Click the “Properties” tab.
    1. Enter the “Buffer Size” in records. Default is 10,000.
    2. Select “Domain Axis Units”, either “Instruction Cycles” or “Real Time”.
  2. Click the “Pin Color” tab.
    1. Select a Pin or Bus from the “Pin Selected” drop-down list.
    2. Specify a color to display.
  3. Click OK to save the Logic Analyzer Settings.

To save, load or clear settings:

  • Click “Save” to save your current definitions to a file (.las).
  • Click “Load” to retrieve your saved definitions from a file (.las).
  • Click “Clear” to clear pin and/or bus definitions in the Settings window.

Logic Analyzer Use

Once the data sources are set up, you need to enter a debug session to view the pin and/or bus data in graphical form. Once you pause, you can examine, scroll or zoom on the displayed data.

The area of the Logic Analyzer window that contains the graph(s) is called a chart.

To view graphical data in the chart:

  1. Debug Run and then Pause (button, breakpoint, etc.) your program.
  2. View the graph(s) of pin and/or bus data.
  3. Debug Run and Pause again to see the data change.

To resize the graph(s) in the chart: Right click on a graph area to pop up the context menu. Select “Auto Range”. The graph(s) will size in the chart.

To zoom in or out of the graph(s) in the chart:

  • Click and drag to select a range of data to zoom in on. Click Reset Zoom to zoom out to the top level.
  • Right click on a graph area to pop up the context menu. Select either “Zoom In” or “Zoom Out” and specify what Axis to zoom.

To scroll the graph(s) in the chart: Use the scroll bar on the bottom of window to scroll the graph(s).

To see the location and value of a graph data point: Hover over a data point to see the point domain location and data value, i.e., (location, value).

Note: For a chart with several graphs, you may need to make the window larger to see the (location, value) pair at the top of a graph.

To compare two sets of data:

  1. Hover over the first graph point and click to set a marker.
  2. Hover of the second graph point and click to set another marker.
  3. The (location, value) delta for each graph will be displayed in the upper right corner of that graph.
  4. To remove a marker, hover close to the marker to be removed, right click and select “Remove Marker”.

To set up the appearance of the chart:

  1. Right click on a graph area to pop up the context menu. Select “Properties”.
  2. In the Chart Properties dialog, enter a Title, Axes Name(s) and other formatting information as you wish.
  3. Click OK when done.

To save, copy or print the chart:

Right click on a graph area to pop up the context menu. Then:

  • Select “Save As” to save the current graph(s) view as an image file.
  • Select “Copy” to copy the current graph(s) view to the clipboard. Paste into any graphic application.
  • Select “Print” to print the current graph(s) view.

Logic Analyzer Window and Dialogs

See 5.3.2 Logic Analyzer Window and Related Dialogs for a list of window controls and all associated dialogs.