1.3.1 Demo Meter Application

The demo meter application software shows how to initialize the Core 1 and the metrology library, and how to interact with the metrology library using the shared memory area and the IPC interrupts. Additionally, it includes several examples of typical features of a metering application (calibration, energy accumulation, storage in non-volatile memory, LCD management, low power modes, …). Accordingly, the demo meter software should be considered as an useful tool to evaluate the features of the metrology library and to speed up the development of the meter application. But it is not intended to be a fully featured and complete implementation of a commercial meter. The meter manufacturer is responsible for the final application development, meeting the required standards, regulatory requirements and features desired for the product The Energy Metering AFE collects the data from current sensors and voltage inputs and digitizes voltage and current data. This data is processed by the Metrology library, running on the Core 1 of the PIC32CXMTx microcontroller. The Demo Meter application has been designed in 2 different ways. One of them uses FreeRTOS as real-time operating system and the other one has been designed in baremetal mode to process data and events.

The present application firmware has the following features:

  • Smart Meter Demonstrator

  • Availability of total and per phase measurements: V, I, Wh, VArh, I2h

  • Availability of total fundamental & harmonics, total fundamental only and per phase Measurements: V, I, Wh, VArh, I2h

  • Terminal command interface allows user to access the Microchip Metrology Library, configure the meter parameters, display measurement results and line voltage status

  • Display cumulative energy Wh, momentary energy Wh, power unit, energy flow, energy flow direction and miscellaneous icons

  • Meter calibration settings

  • Meter default configuration, meter configuration saving and loading in non-volatile memory

  • Power fail detection and measurements saving and restoring in non-volatile memory

  • LCD display management

  • Support Rogowski, Current Transformer and Shunt current sensors

  • Phase A, B & C mth harmonic only measurements: V2h, I2h, Wh, VArh

  • Line voltage monitor per phase: swell, sag, zero-crossing, frequency

  • ADC samples data capture

  • Support Single-phase meter, neutral current meter and others

  • Total 3 output pulses with pulse source selection

In order to separate functionalities, there are six application files, each one with its own state machine:

  • Metrology application: Handle the metrology driver and its configuration.

  • Energy application: Interact with the metrology application to gather energy consumption. Energy consumption is assigned and grouped into different time zones. This application also manages the RTC peripheral.

  • Events application: Interact with the metrology application to store the event happening and its occurrence time.

  • Console application: Interact with the application using a serial port to send commands to the board and receive data.

  • Datalog application: Write/Read data information to/from the external flash memory.

  • Display application: Navigate through the different data shown in the display using the buttons Scroll Down and Scroll up of the demo boards.