10 Data Visualizer Setup

10.1 Data Visualizer Debug GPIO Setup

The image below shows the (Timer Toggle LED Example), which uses Debug GPIO from the MPLAB Data Visualizer. The following configuration steps are needed to set this up:

  1. Click the icon to open the MPLAB® Data Visualizer.
  2. Under Debug GPIO, click the icon, to add to the time plot.
  3. Click the Horizontal Zoom button, or use the mouse scroll wheel to zoom into the Time Plot.
  4. Click the Vertical Cursor button to add cursors. You can then measure the time between cursors.
    Tip:
    1. Go to AVR TCA PLIB Driver, PIC Timer0 PLIB Driver for a video on how to use the MCC Melody 100 ms Timer.
    2. If you are new to MPLAB® Data Visualizer, see Debug GPIO Hello World (Microchip University).

10.2 Data Visualizer Terminal Setup

The image below shows an example (ADCC Basic Printf), which uses both Debug GPIO and the Terminal, from the MPLAB Data Visualizer. The following configuration steps are needed:

  1. Click the icon to open the MPLAB Data Visualizer.
  2. Under Debug GPIO, click the icon, to add to the time plot.
  3. Under the COMx port, associated with your board, click the icon to set the baud rate to 115200.
  4. Then click the icon to display text from the COMx port on the terminal.

When using the MPLAB Data Visualizer Time Plot to run the ADC with Computation Basic Printf example, the following will appear:

10.3 Data Visualizer Setup for MCC Melody Data Streamer

When using the MCC Melody Data Streamer Library, this section describes the steps needed to set up the Data Streamer and plot the selected application variables.
Note: These steps will come after configuring the appropriate components in MCC Melody and clicking to generate code.
Figure 10-1 10-4. An example application using the MCC Melody Data Streamer Library

As part of the MCC Melody configuration, application variables to be plotted must be added to the Data Streamer Table, giving each a Variable Name and corresponding Variable Type. Once done, this will look similar to examples 2 and 3 from the ADC Example Component.

  1. Within MPLAB X click the icon to open the MPLAB Data Visualizer.
  2. Under the Variable Streamers tab (on the left-hand side), click the button to import a .ds file.
  3. From your project root, navigate into mcc_generated_files/data_streamer/ directory.
  4. Click the data_streamer.ds file to select it.
  5. Then click the button to load the ds file.

Data Visualizer Configuration

Tip: Load the MCC generated data_streamer.ds, meaning the Data Streamer variable configuration file, as follows:

Choose a data source that matches the desired data stream protocol format

Plot all variables

Tip: Note that the Time Plot is set to . Plot all variables sets this to .

The results when plotting the respective examples are shown below:

Figure 10-2. ADC Data Streamer
Figure 10-3. ADC Spike Detect

10.4 Data Visualizer Setup for DV Run Time

When using the MCC Melody DV Run Time Library, this section describes the steps needed to set up the DV Run Time in the MPLAB Data Visualizer.
Figure 10-1 10-4. I2C Host Proximity Sensor Example, using the DV Run Time Example Visualization
Tip: The steps below assume that an example like the one above is correctly configured in MCC Melody and that the button is pressed to generate the code.
Tip: For the Data Streamer, application variables to be plotted must be added to the Data Streamer Table. The DV Run Time is different in that variables, in the form of debug symbols, are exposed by loading an appropriate .elf file. To increase the ikelihood that a variable's debug symbol can be found, set the variable to volatile and/or static.
Tip: For volatile variables, this .elf file contains their name, address and type (length in bytes), i.e., at compile time, it is known where volatile variables will be located in the Microcontroller's RAM.
  1. Within MPLAB X click the icon to open the MPLAB Data Visualizer.
  2. Click on the Under the button to start a new, or show current DVRT Session.
    Tip: A new DVRT Session will open as follows:
  3. Next one needs to select a data source matching the DVRT protocol format. This will be the COM port (UART) that was configured as a dependency to the MCC Melody DV Run Time Library.
  4. Configure the Data Visualizer COM Settings (PC side) to match what was configured in the MCC Melody DV Run Time Library (MCU side).
  5. Next load the .elf debug symbols file.
    Attention: You must choose the debug or production version of the .elf, matching your compilation settings.
    • Debug, if you are in a debug session
    • Production, if you have simply programmed your MCU
  6. Add variables to DVRT Streaming Table.
    Tip: The volatile and static variables will show up in the symbols file.
  7. Reposition DVRT Streaming Table.
    Tip: One can drag the DVRT Streaming Table to the bottom pannel of the Data Visualizer, to view this table at the same time as the Time Plot of variables.
  8. Once you click the Plot all variables button, the Dvrt Procol starts streaming and the Time Plot starts rolling.