X2Cscope plugin for MPLAB X

Table of contents

  1. Recommended to use the new python package for scripting: https://x2cscope.github.io/pyx2cscope/
    1. Install X2Cscope plugin within MPLAB X
    2. Connect X2Cscope to the device
    3. Use the Watch window
    4. Use the Scope window

Recommended to use the new python package for scripting: https://x2cscope.github.io/pyx2cscope/

The MPLAB X plugin is not updated anymore.

Install X2Cscope plugin within MPLAB X

You will need MPLAB X IDE v5.40 or newer. www.microchip.com/mplabx

  1. Open MPLAB X IDE.
  2. Navigate to Tools–>Plugins at the top bar.
  3. Slect X2Cscope for install.
  4. Restart MPLAB X IDE.
  5. Open X2Cscope from Tools->Embedded->X2Cscope

X2Cscope plugin install

Connect X2Cscope to the device

  1. Select project

MPLAB X support multiple project to be open, so we have to select which one to use for X2Cscope debugging.

selectProject

  1. Set communication configuration

Set the communication(Serial, CAN, TCP/IP) configuration according to the HW settings. Demos are using UART (Serial) set to 115200 8N1 by default. Check the serial port at the device manager, if you have multiple COM port.

UARTSettings

  1. Program your device

At this point make sure your program is running on the target device with the integrated X2Cscope library with the same communication configuration. Build the code and program your device if needed. Connect phisical communication connectors to the PC and to the hardware.

  1. Connect to the Device

Click on the disconnected connector icon to connect to your device.

Connect

If you get an error message:

Error

Then go to the project settings (Right Click on the project and select Properties menu). Select the Loading category and tick the “Load symbols when programming or build for production” option.

LoadSymbols

Then apply the new settings. Then do points from 1. to 4. again.

Use the Watch window

  1. Set watch sampletime. (This will be the refresh rate of the watch window)
  2. Open Watch window from Data Views tab.
  3. Add/Select variables to the watch list.
  4. The actual values of the selected variables will be visible in run-time.
  5. Values of the variables can be modified. The new assigned value will be sent to the target device in run time!
  6. Scaling, offset and unit boxes can be used for easier representation. (These parameters will be automatically saved.)

UseWatch

Use the Scope window

  1. Set sample time of scope. Attention! Set this according to the period of X2Cscope_update(); function call. (See Firmware guide.)
  2. Open Scope window from Data Views tab.
  3. Click to the empty Source box to select source signal/variable.
  4. Click Sample to start the scope.
  5. Uncheck “Single-shot” to do continuous sampling.
  6. Use trigger settings if neccesary.

UseScope