SLAA494B May 2011 – September 2023 MSP430AFE221 , MSP430AFE222 , MSP430AFE223 , MSP430AFE231 , MSP430AFE232 , MSP430AFE233 , MSP430AFE251 , MSP430AFE252 , MSP430AFE253
Power and energy are calculated for a frame's worth of active and reactive energy samples. These samples are phase corrected and passed on to the foreground process that uses the number of samples (sample count) and use the formulae listed below to calculate total active and reactive powers.


v90 (n) = Voltage sample at a sample instant ‘n' shifted by 90°
Kp = Scaling factor for power
The consumed energy is then calculated based on the active power value for each frame, similar to the way the energy pulses are generated in the background process except that:
EACT = PACT × Sample count
For reactive energy, use the 90° phase shift approach for two reasons:
Because the frequency of the mains varies, it is important to first measure the mains frequency accurately and then phase shift the voltage samples accordingly. This is discussed in Section 5.3.3.
The phase shift consists of an integer part and a fractional part. The integer part is realized by providing an N samples delay. The fractional part is realized by a fractional delay filter (see Section 5.3.2).