SLAA638A august 2014 – may 2023 MSP430I2040 , MSP430I2041
In the background, time-critical sample-based process is performed. The flow of the background processing is straight forward, the process started at the sample rate by a trigger of sampling complete interrupt. The background process then:
Figure 2-5 shows the system functional diagram, the two SD24 ADCs take samples from the voltage and the current channel with the (calibrated and programmed) fractional delay. The samples are then passed through a DC removal filter. Each DC removal filter dynamically tracks the DC offset of the ADC and the signal by analyzing each sample and removes the DC (from signal and from ADC DC offset) before passing the sample to further processing. If the operation is in DC mode, the DC removal filter only removes the DC offset of the ADC.
The current sample and the voltage sample then performs a square and accumulates to get the root mean square current (Irms) and voltage (Vrms). The current sample also multiplies and accumulates with the voltage sample with proper additional phase delay (if needed) to get the active power (Pactive) and with the corresponding 90° shifted sample to get the reactive power (Preactive).
An internally generated pure sine wave amplitude and phase synchronized with the AC voltage input together with the 90° shifted version are used to multiply and accumulate with the current sample to get the fundamental active and fundamental reactive power.
The cycle detection mechanism detects the presence of an AC signal by checking the number of zero crossing over a pre-defined time. If the number of zero crossing is less than the expected number of zero crossing minus 1, then it is determined to be DC mode otherwise it is in AC mode. This works well for the frequency from 25Hz when the pre-defined determination interval is set to 80 ms.
After 4 AC cycles (or 80 ms in DC mode), the system sets a flag showing that there are results that are needed to be processed. The system is then triggered by this flag to perform the scaling and convert those accumulated values into values of proper units (V, A, W, and so forth).