3.3 MPLAB Harmony v2 and MPLAB Harmony v3 PLIBs Differences

The major differences between MPLAB Harmony v2 and MPLAB Harmony v3 PLIBs are as follows:

  • MPLAB Harmony v2 PLIBs do not have any MHC configuration options. The PLIB initialization code must be manually written. However, MPLAB Harmony v3 provides the MCC configuration options for the PLIBs, and based on the configuration it generates the PLIB initialization code.
  • MPLAB Harmony v2 PLIBs have APIs to read and write almost every register field of a peripheral module, which requires many APIs per module. Though that gives flexibility, it expects the user to call multiple APIs, sometimes even in a sequence, to perform a task. On the contrary, MPLAB Harmony v3 abstracts the peripheral features and has direct APIs to perform meaningful tasks. It takes care of manipulating multiple register fields and sequencing in the implementation, thereby making the usage simple and quick.
  • MPLAB Harmony v2 PLIBs have the same API for a different instance of a peripheral. It provides an argument to distinguish between instances, thereby keeping the API signature the same. However, MPLAB Harmony v3 provides dedicated APIs for different instances.
  • MPLAB Harmony v2 provides device-specific pre-compiled library files (in form of .a) and header files to use its PLIBs. Based on optimization level, either library file implementation or header files inline implementation gets used. However, MPLAB Harmony v3 generates and adds a .c file for every PLIB instance, which has the definitions of the provided interface.