2.5 Adding Harmony Modules to Project

  1. In MCC Project Graph window, expand the Device Resource pane by clicking its button on the left of Project Graph.
    Figure 2-6. Device Resource Pane
  2. Look for PIC32CXMTG-EK component under SHD category and add it using the Green Plus sign.
    Figure 2-7. Add PIC32CXMTG-EK Component
  3. This automatically triggers the activation of Core component. Click Yes to activate it.
    Figure 2-8. Core Component Auto Activation
  4. FreeRTOS component can also be activated (it is offered), but in the case it is not needed, so click No when prompted.
  5. Time Component.
    1. Navigate to System Services and add TIME component by clicking the Green Plus sign.
      Figure 2-9. Add Time Component
    2. Right-click the TMR dependency and select Available Satisfiers>TC0 (tc0).
      Figure 2-10. Select TC0 for TMR
    3. Modify Clock Source on TC0 component, as there is no need for accuracy in this project.
      Figure 2-11. Modify Clock Source on TC0
  6. On PIC32CXMTG-EK Main Board component, select PL460-EK v5 (G3 MAC RT) to be connected to Xplained Pro Connector.
    Figure 2-12. Select PL460-EK v5 on Xplained Pro Connector
  7. This automatically adds, and configures the following components:
    • G3 MAC RT Driver
    • FLEXCOM5
    • PLC PVDD Monitor
    • ADC
  8. Most of these components are auto-configured by PIC32CXMTG-EK component when components are auto-activated. Only ADC has to be manually configured to set its prescaler and enable an interrupt, as shown in the following figure.
    Figure 2-13. ADC Manual Configuration
  9. On G3 MAC RT component, right-click the PCOUP Dependency and select PLC PHY Coupling from Available Satisfiers.
    Figure 2-14. Add PLC PHY Coupling
  10. Add TRNG component from Peripherals section. This will be used in this example for Random Number generation.
    Figure 2-15. Add TRNG Component
  11. Add and Configure RF215 component:
    1. Navigate to Drivers Section inside SmartEnergy and add RF215 component by clicking the Green Plus sign.
      Figure 2-16. Add RF215 Component
    2. Right-click the SPI dependency and select Available Satisfiers>FLEXCOM3 (flexcom3).
      Figure 2-17. Select FLEXCOM3 for SPI
    3. FLEXCOM3 component is auto-configured when connected to RF215 component.
    4. Click the RF215 component, on Configuration Options set Pins so configuration matches the following:
      Figure 2-18. RF215 Configuration
  12. Add and configure Cryptographic Library:
    1. Navigate to Libraries Section and add Crypto_v4 component by clicking the Green Plus sign.
      Figure 2-19. Add Crypto Library Component
    2. Right-click the LIB_WOLFCRYPT dependency and select Available Consumers>wolfCrypt Library (lib_wolfcrypt).
      Figure 2-20. Select wolfCrypt for LIB_WOLFCRYPT
    3. Click the Crypto_v4 component, on Configuration Options enable Security options required by G3 and supported by HW on the MCU, as seen on the figure:
      Figure 2-21. Crypto_v4 Configuration
    4. Do the same on wolfCrypt Library component to select the required Security options using SW implementation:
      Figure 2-22. wolfCrypt Configuration
  13. Finally, on PIC32CXMTG-EK component, enable the use of LEDs and User Button.
    Figure 2-23. Enable LEDs and Button on PIC32CXMTG-EK