Getting Started with MPLAB® Code Configurator (MCC) for MPLAB Extensions in VS Code®
MPLAB® Code Configurator (MCC) for MPLAB Extensions is an extension for VS Code® that provides an interface to develop project code for device peripherals and functions. The extension is similar to the MCC plug-in for MPLAB X IDE. Some MCC extension features of note are:
- As with the MCC plug-in, creating or importing an MPLAB project and then opening the MCC extension (MPLAB MCC: Launch) will associate the MCC configuration with that project. For an imported project with content from the MCC plug-in, the extension will attempt to open the project with existing MCC information.
An MCC configuration can be created without being associated with a project. Once created, an MCC configuration can then be associated with a project (default configuration) or a specific project configuration for projects that have more than one.
Launch the MCC extension and select Create New MCC Config > Create New Standalone MCC Config.
To associate this configuration with a project, use MPLAB MCC: Configure Associated Project.
The table below documents the important workflow differences between how this extension works and how the MCC plug-in works with MPLAB X IDE.
Action or Term | MPLAB X IDE | VS Code | VS Code Notes |
---|---|---|---|
Installation | On the MPLAB X IDE menu:
| From the VS Code Marketplace, install the latest MPLAB Extension pack. The MCC extension is included. | |
Documentation | Go to the "MPLAB Code Configurator" webpage or "Online Technical Documentation" . | Click on the installed extension to view the extension overview page with video link: |
|
Device support | To find support:
| To find support:
| (1) MCC Classic is not supported in the extension. |
Open MPLAB project | Options are:
The project will open in MPLAB X IDE after selecting an option. | Options are:
The project will open in VS Code after selecting an option. | (1) To open the command palette, use Ctrl + Shift + P or from the Search bar enter the greater-than symbol (>). |
Launch MCC | Click on the MCC icon ![]() | In the command palette, enter "MPLAB MCC: Launch". ![]() | |
Create MCC configuration | There are no separate MCC configuration files. All built MCC files are placed into the project. | Select Create New MCC Config (1) for projects (default config) without any existing configuration files (2). If your project has MCC files (e.g., from an imported project), the extension will attempt to open with this existing information. | (1) When the workflow to create a new MCC config is complete, the configuration will fail to load and you will see the notification: MCC shut down due to VS Code restarting extensions. (2) If there is more than one project configuration, you can create another MCC config for that project configuration. |
Associate with project | The MCC UI is already associated with a project on opening. | Choose either: Path 1: Select a project you want associated with the MCC configuration.
Path 2: Select Create a New Standalone MCC Config to create the configuration now and associate it with a project later (1). The MCC config will open in VS Code. | (1) After the configuration is created, in the command palette, enter "MPLAB MCC:Configure Associated Project".
|
Path 1 Configure MCC configuration | MCC configuration files are always associated with the project. | Either follow the default flow or customize with Other Options. | |
Path 1 Open MCC | The MCC UI will open in a tab. For details on using the interface, see Documentation in row 2. | The MCC UI will open in a tab. For details on using the interface, see Documentation (1) in row 2. | (1) Includes video links which show examples of using the MCC UI and generating code. |
Path 1 MCC-generated files in an associated project | MCC-generated files are integrated into the associated project’s folders. Some files, such as main, may also be edited.![]() | MCC-generated files are placed in their own folder under the associated project's main folder. The project’s .json file (under .vscode) is edited to include the location of the MCC folder and files for the project build (1).![]() | (1) Go to the end of this table for how to build a project. |
Path 2 Configure MCC configuration | N/A | In the command palette, enter "MPLAB MCC: Launch". Select MCC Config to open the MCC UI. | |
Path 2 Open MCC | N/A | The MCC UI will open in a tab. For details on using the interface, see Documentation (1) in row 2. | (1) Includes video links which show examples of using the MCC UI and generating code. |
Path 2 Associate project with standalone MCC config | N/A | To associate the generated files with a project, in the command palette, enter "MPLAB MCC:Configure Associated Project".
| |
Path 2 MCC-generated files for standalone MCC config | N/A | In the MCC UI, click the Generate button to create the code. The project’s .json file (under .vscode) is edited to include the location of the MCC Config folder and files for the project build. Under MCC Config, in the mcc>mcc.vscode file, the associated project is referenced. | |
Build project | In the Projects tab, right-click on the project name and select Build or Clean and Build. | In the command palette, enter "MPLAB CMake: Build" or "MPLAB CMake: Clean Build". |