
Chapter 5
SLAU587 – August 2014
Firmware and Embedded Metering Library API
5.1
Introduction
The EVM comes with pre-tested firmware that enables the EVM to operate. The source code together with
the embedded metering library, as an example application is provided. In this chapter the structure of the
firmware, the summary of the APIs of the embedded metering library will be discussed.
5.2
Firmware Structure
The firmware the comes with the EVM is designed to use a layered approach isolating the user from the
details of metrology and the associated computations involved so that the programming work is simplified.
The firmware is partitioned into three main blocks:
1. The application
•
System setup and initialization
•
Main loop
•
Communication protocol and command handling
•
Non-volatile parameters preset and manipulation
2. The metrology computation engine, packaged into a library named emeter-metrology-i2041.r43
NOTE:
The source code of this library is not included in the package. Contact the Texas Instrument
Sales Team in your area if the source code is needed.
•
ADC setup
•
Parameter initializations
•
Sample based background processing
•
Reporting cycle based foreground processing
•
Reading application interface
3. The toolkit packaged into a library named emeter-toolkit-i2041.r43
•
Low level computation routines
5.3
Toolkit Package
The low-level computation engine provides speed optimized processing for common arithmetic operations
in metrology. Functions include:
•
48-bit accumulation
•
24-bit high pass filtering and dc offset removal (dc mode)
•
16-bit high pass filtering and dc offset removal (dc mode)
•
Reference pure sine wave generation
•
48-bit by 16-bit division
•
16-bit by 16-bit and 32-bit by 16-bit multiplication
•
16-bit, 32-bit, and 64-bit square root and integer square root
•
16-bit by 16-bit multiply-accumulate into 48-bit accumulator
•
16-bit by 24-bit multiply-accumulate into 64-bit accumulator
33
SLAU587 – August 2014
Firmware and Embedded Metering Library API
Copyright © 2014, Texas Instruments Incorporated