6.3.8 Work with Multiple Projects

MPLAB X IDE allows you to work with more than one project.

Multiple projects can be opened in MPLAB X IDE and viewed in the Projects window. For more about this window, see 14.24 Projects Window.

Figure 6-33. Multiple Projects in the Projects Window

Open Multiple Projects

You can create (File > New Project) or open (File > Open Project) more than one project in MPLAB X IDE directly.

Alternatively, you can use the --open directive in a short cut, as in:

"C:\Program Files\Microchip\MPLABX\vx.xx\mplab_platform\bin\
mplab_ide.exe" --open "C:\MPLAB_X_Projects\MyProject1"

Then you can create multiple short cuts to open multiple projects from many different locations.

Define Main Project

Each project can be made active, or the focus of development, as described below. However there should only be one main project at any time.

Main Project

A single project can be selected as the main project by right clicking the project name and selecting Set as Main Project. The main project name will then appear in bold. In this case all the toolbar functions will be executed on the one main project.

Active Projects

You can also work without setting a main project. Active projects are the projects in focus when there is no main project.

Projects may be made active by clicking on them in the Projects window. In that case, the IDE will know which project you are working on by context, i.e., if you set the editor focus on a file, then the project that owns that file will become the active project. The active project receives all actions, e.g., when you click the Debug icon.

Develop Project Code

To develop and debug your code for each project:

  1. Start debugging a project by clicking on the project in the Projects window and then selecting Debug > Debug.
  2. If you are running multiple simultaneous debug sessions, open the Sessions window (Window > Debugging > Sessions) and you can switch between any currently running debug session.

When one debug session is switched to another, the Watches window and variables plus the memory will switch to show the currently selected project being debugged. The Status bits should also follow the debug project. The Dashboard will follow the last selected whether it is a debug project or a project in the project window. This is by design.

If you have the option Maintain active connection to hardware tool selected under Tools > Options (MPLAB X IDE > Preferences for macOS), Embedded > Generic Settings, a reconnect WILL BE performed when you switch sessions/projects. This is by design.