1.2.8 Running Demonstration Example

This chapter shows a simple example of use of the Demo Meter Application running on a real environment, measuring from a connected load. The setup is a light bulb connected to a PIC32CXMTSH-DB board through a Current Transformer, as depicted in the following image:

Figure 1-64. Example Setup

Build the provided example application and Flash it into the evaluation board from MPLAB X IDE.

Figure 1-65. Make and Program Device
Setup the Terminal interface:
  • A virtual COM port will be detected on the computer, when the USB cable is connected to USB-UART connector.
  • Open a standard terminal application on the computer, such as Hyper-terminal or Tera Term, and configure the virtual COM port.
  • Set the serial baud rate to 115200 baud in the terminal application.
  • See that the initialization prints a command prompt on the serial port terminal.
Figure 1-66. Empty Prompt
To see the available commands, HELP command is invoked:
Figure 1-67. Help Command

Before reading the measures, let us calibrate the Metrology. To do so, the user will use the Automatic Calibration. For more details on this topic, refer to the Automatic Calibration.

First, send a CONF command with the HW configuration in evaluation board:
Figure 1-68. CNF Command
Then, send the CAL command with the expected values. 220V, 0.2727A (60W bulb), 0º between Voltage and Current:
Figure 1-69. CAL_A Command
Once calibrated, the user can start requesting the calculated values to the metrology:
Figure 1-70. PAR Commands

See that the result is the expected (with slight differences, due to being connected to real mains, and not to a stabilized power source).

From this point, the user can look at different registers to check the configuration and status values, through DCR and DSR commands.
Figure 1-71. DCR and DSR Commands

Refer to the “PIC32CXMTx Metrology Reference Guide” (DS50003461) to understand the value of each register.