3.2.1 Harmony 3 ICM Compare Mode Example

This topic provides instructions and information about the MPLAB Harmony 3 ICM compare mode demonstration application, which is included in the MPLAB Harmony Smart Energy Metrology Applications distribution.

Description

This demonstration application configures the ICM peripheral to perform a hash calculation over 3 memory regions through the use of transfer 2 descriptors located in the ICM Descriptor area.
Figure 3-7. ICM Compare Mode Descriptors Configuration

Harmony MCC Component Blocks

Figure 3-8. ICM Compare Mode Project Graph for PIC32CXMTG EK

The virtual COM Port interface is enabled to provide an output console.

Figure 3-9. PIC32CXMTG EK Configuration

When enabling the Virtual COM Port interface, the SYS_CONSOLE is automatically loaded and connected to the FLEXCOM0 peripheral library. However, the application is designed to use the standard input/output service, so the SYS_CONSOLE service must be deleted and replaced by the STDIO service.

Figure 3-10. SYS_CONSOLE Automatic Activation
Figure 3-11. STDIO Selection

Harmony ICM Code Configuration Options

The ICM peripheral library is configured to enable 2 memory regions. Since the application is focused in detecting a digest mismatch, Region Digest Mismatch interrupts must be enabled in each region configuration.

Figure 3-12. ICM Configuration Options

Building the Application

This section identifies the MPLAB X IDE project name and location and lists and describes the available configurations for the demonstration.

The parent folder for these files is smartenergy_metrology\apps\peripherals\icm\icm_compare_mode. To build this project, the user must open the smartenergy_metrology\apps\peripherals\icm\icm_compare_mode\pic32cxmtg_ek.X project file in MPLAB X IDE.

MPLAB X IDE Project Configurations

This table lists and describes the supported configurations of the demonstration, which are located within ./src/config.

Project NameConfigurationDescription
icm_compare_mode_pic32cxmtg_ekpic32cxmtg_ekThis demonstration runs on the PI32CXMTG Evaluation Kit.

Running the Demonstration

Figure 3-13. ICM Compare Mode Demo Application