3.1 How to Start Using Harmony v3 PLIBs

The MPLAB Harmony v3 PLIBs are part of a Chip Support Package (CSP). They can be used by downloading (or cloning) the csp repository from the MPLAB Harmony GitHub page as described in the Tools and Installation section. The user needs to follow the steps below to configure the MPLAB Harmony v3 PLIBs:

  • As described in the MCC section above, all the MPLAB Harmony v3 resources, including PLIBs, are listed in the Device Resources window as shown in the following figure. The PLIB resources may have multiple instances, which denote corresponding multiple hardware instances of that peripheral. For example, a device for which a MPLAB Harmony v3 project is being created, may have six UART peripherals, and these UART peripheral instances are listed inside the UART as shown in the following figure. Double-click on the peripheral instance for which PLIB to be used. This will place the corresponding PLIB component on the project graph.
    Figure 3-1. Device Resources - Peripherals
  • After the PLIB component is added on the project graph, select it by clicking on it. This will make its configuration options appear on the configuration options towards the right as shown in the following figure. Configure the PLIB as required by the application.
    Figure 3-2. Peripheral Configuration
  • Once PLIB configuration is complete, generate the code and start using the PLIB APIs to develop the application. Code for the finished PLIB configuration is generated inside the <plib name>_Initilize function and this function is automatically called from the SYS_Initialize() function of the initilization.c file.