6 Plot Graph In MPLAB® Data Visualizer

MPLAB Data Visualizer is a program for processing and visualizing data from a running embedded target and can be accessed as a plugin or a stand-alone program. This application note describes the configuration of the Data Visualizer to graph ADC acquisitions received over USART. The configuration is done using a saved workspace, and the basics of displaying the data are explained. Click the Documentation button in MPLAB Data Visualizer for a detailed guide on how to set up your workspace.

Todo: Configure MPLAB Data Visualizer to graph received ADC samples.
  1. MPLAB® X IDE has an internal Data Visualizer. Click on the DV button at the top to open it. If this button is not there, go into Tools and Plugins to install the Data Visualizer.
    Figure 6-1. Opening the Data Visualizer in MPLAB® X IDE
  2. Open the program and plug in an already flashed device. Make sure the COM-port used for USART communication is not already in use. The start screen will look similar to the one in Figure 6-2, apart from the plotted graph.
    Figure 6-2. MPLAB® Data Visualizer Starting Page
    1. Highlight the correct COM-port by clicking it.
    2. Set Baud rate to 19200.
    3. On the right-hand side, select ATtiny1627 from the source drop-down menu.
    4. Click on the play button.
    5. If the Data Visualizer plots a graph similar to the one in Figure 6-2, the USART configuration is set up correctly.
    6. Click the stop button.
  3. Find and open the Variable Streamer configuration panel to graph the streamed data output of the device.
    Figure 6-3. Open the Variable Streamer
    1. Click the Variable Streamers panel on the left-hand side.
    2. Click on New to open the Variable Streamer configuration panel.
  4. Configure the Variable Streamer to decode the streamed data output according to the Stream Format.
    Figure 6-4. Configure Variable Streamer
    1. Set a Variable Streamer Name.
    2. For Framing Mode, select Ones’ Complement from the drop-down menu.
    3. Set the Start of Frame byte to 0x3c.
    4. Add variables by clicking the plus sign. Remember to add them in the correct order, as shown in Figure 6-5.
    5. For Type, set all variables to Float32.
    6. Click Save in the bottom right when all variables have been added.
    Figure 6-5. Plot Variables
    1. Select the correct COM-port from the source drop-down menu.
    2. Click the graph icon at the top to plot all variables.
    3. You can now delete the data axis containing the non-arranged data by clicking the trash can on the right-hand side.
    4. Add Plot allows you to add a new source to plot in a given data axis set.
    5. Add Data Axis allows you to add a new set of axes to plot several sources.
    6. Figure 6-6 shows an example of how to group the different variables in different axes to give a better visual representation of the values.
  5. Click Show Live Data to start plotting live data from the device. If set to auto-adjust, the axes will scale according to the input from USART. Figure 6-6 shows an example of the plotted result when pushing the button on the Curiosity Nano, which cycles through the four different states in which the load on the breadboard circuit can be.
    Info: By clicking on “Save Workspace”, Data Visualizer generates a file that can be used for an agile loading of the workspace by clicking “Load Workspace” and choosing the generated file.
    Figure 6-6. Plot Configuration Completed
Result: The MPLAB Data Visualizer has been configured to graph data received from the nEDBG USART serial gateway.