2.3 Project Graph

The Project Graph shows all the modules being used in the project with more details. In the MPLAB Harmony software framework, few modules are closely associated with Microcontroller hardware, such as Peripheral libraries, and few modules are not directly associated with the hardware, but are dependent on the hardware associated modules. For example, MPLAB Harmony drivers are dependent on peripheral libraries. There are also software modules which are dependent on MPLAB Harmony drivers, such as File system service, middleware libraries.

Since MPLAB Harmony has such varied software modules with dependency structure, a monolithic configuration tree, which was present in MPLAB Harmony v2, sometimes becomes difficult to manage and configure. This problem is addressed in MPLAB Harmony v3 by the Project Graph window. In the Project Graph window, each module is shown in the form of a rectangular box. Towards the left-side edge of these rectangular boxes, there are small boxes (Dependency box) shown, which indicate the dependency of the module. Having a dependency means, the module is dependent on some other module for its correct functionality. For example, the USART Driver module has dependency on the UART (or USART) PLIB. Similarly, towards the right-edge of the rectangular boxes, there will be small boxes (Capability box) shown, indicating capability of the module. Having capability means the module is exposing its features to other modules. For example, the UART PLIB module has the capability of the UART, the SERCOM PLIB module has the capabilities of the UART, I2C and SPI. The following figures show examples of modules, their dependency, and capability:

Note: Few modules will not have any dependency or capability, for example, PLIB modules do not have any dependency and the System module has neither dependency nor capability.
Figure 2-2. Capability of a PLIB Module
  • UART6 Peripheral Library (PLIB) is the module
  • No dependency for UART6 PLIB
  • UART6 PLIB has one capability: UART
Figure 2-3. Dependency and Capability of a Driver Module
  • USART Driver is the module
  • Two dependencies on the USART driver: Core Service and UART
  • USART Driver has one capability: DRV_USART

On the project graph, a dependent module can be connected to a corresponding capable module to use dependent module correctly. This step of connecting two modules to use the dependent module is called as satisfying the dependency. The dependency can be satisfied in the following three different ways:

  1. Click and then hold and drag the mouse pointer between the dependency box and capability box as shown in the following figure:
    Figure 2-4. Satisfying Dependency 1
  2. Right-click on the dependency box, and then select the appropriate satisfier as shown in the following figure:
    Figure 2-5. Satisfying Dependency 2
  3. Right-clcik on the capability box, and then select the appropriate consumer as shown in the figure below:
    Figure 2-6. Satisfying Dependency 3

Ensure that all the dependencies of the modules are satisfied before configuring the modules and generating the code. The following figure shows how the modules look after satisfying dependency:

Figure 2-7. Connected Modules

Additionally, users can move module boxes within the Project Graph Window (click and then hold and drag) to arrange them appropriately to ensure the project graph appears organized.