2.4 CT Signal Preamplification
The CT signal is amplified by the operational amplifier using two gain settings. The first gain setting provides a full-scale input to the ADC at maximum current. The second gain setting further amplifies the signal 16 times. These two signals are connected to two ADC12 input pins.
3 Software Implementation
Software is implemented into two major areas, the foreground process and the background process. The background functions use a timer interrupt to trigger the ADC and to collect the voltage and current samples of each phase. These samples are further processed and accumulated into buffers. The background function deals mainly with the timing-critical elements of the software.
Once sufficient samples have been accumulated, the foreground functions are used to calculate the final values of Vrms, Irms, frequency, and power.
A separate library, emeter-toolkit-449.lib, contains most of the commonly used mathematical routines. Also, a setup file contains the initialization routine for the device. Other files include the RTC software implementation, other mathematical functions, and the display functions.
After system reset, the MSP430 hardware is first set up (see Section 3.1). The program then enters the main foreground process loop and waits for the timer interrupt routine to gather data.