TIDUFK2 September 2026
The design uses the TI Energy Measurement Library originally provided for MSPM0-based metrology applications. The device-independent calculation modules are retained without functional modifications. Detailed descriptions of the RMS, power, energy, phase, and harmonic calculations are available in the corresponding TI Energy Measurement Library documentation. This section therefore focuses on the integration of the library into the CC2340R53 application.
The original platform-specific sample acquisition is replaced by the internal ADC of the CC2340R53. After applying the factory-programmed ADC gain correction, the current and voltage codes are centered around the ADC midpoint and converted into the signed IQ23 fixed-point format expected by the library. Only the load-current and line-voltage channels are passed to the Metrology processing. Relay-current and temperature measurements are handled separately by the application.
For every processed sample pair, the Protection task calls the Metrology background process. This process performs DC-offset filtering, zero-crossing detection, and accumulation of the intermediate quantities required for the electrical calculations. When the background process indicates that a complete measurement frame is available, the foreground process calculates the reported electrical parameters. These include:
The library is configured for single-phase operation through template.h. The principal configuration parameters include the 8kHz sampling rate, nominal mains frequency, nominal voltage, and default current and voltage scaling factors. These default values provide initial operation before the device has been calibrated.
The hardware abstraction layer maps the library's platform-dependent functions to the CC2340R53 application. This includes nonvolatile calibration storage and the optional UART calibration interface. Calibration parameters are stored in a dedicated NVS region together with a versioned header and CRC. At start-up, valid stored parameters are loaded by the Metrology library. Otherwise, the compiled default calibration values are used. Energy-pulse GPIO outputs are disabled because they are not required by this circuit-breaker design.
After each Protection-task execution, the latest measurements and breaker state are copied into a coherent application snapshot. The Zigbee task reads only this published snapshot. The optional calibration GUI accesses the internal Metrology working data.