1ph Energy Measurements

35
UTXD0 RS 232 BRIDGE V1-/ Vref(O) SPI Vref(I) URXD0 HF crystal 8 MHz XT2 IN XT2 OUT Analog to Digital I In V In AC mains V1+ I1+ I1- N L RST VSS VCC LOAD V1- VREF GPIO MSP430 AFE SOMI SIMO APPLICATION PROCESSOR UART TO PC VCC GND VCC GND VCC GND SPI I/O I/O SPI MSP430AFE JTAG F663x JTAG Capacitive Power supply AC mains L N MAX A B C kWh REAC TEST kW MSP430 F663x LCD DISPLAY ISOLATED AC/DC POWER SUPPLY USB USB COMM TO PC ELECTRICAL ISOLATION BOUNDARY Optical Digital Isolators Wireless Daughter Card EMK Interface 20-pin 20-pin SPI SCLK SCLK TI Designs Single-Phase Electric Meter with Isolated Energy Measurement TI Designs Design Features TI Designs provide the foundation that you need Simplified Meter Calibration by Using USB including methodology, testing and design files to Connection quickly evaluate and customize the system. TI Designs Isolated Communications Between Metrology AFE help you accelerate your time to market. and Host MCU TI Energy Library for Metrology Calculates All Design Resources Energy Measurement Parameters Design Page TIDM-METROLOGY-HOST Host MCU Application Controls Onboard LCD and Meter Calibration MSP430AFE253 Product Folder MSP430F6638 Product Folder Single-Phase Energy Measurement Achieves Class ISO7420 Product Folder 0.2 Accuracy ISO7421 Product Folder Segment LCD on Board TPS77033 Product Folder Featured Applications TPD4E004 Product Folder Metering Street Lighting ASK Our E2E Experts WEBENCH® Calculator Tools All trademarks are the property of their respective owners. 1 TIDU455 – August 2014 Single-Phase Electric Meter with Isolated Energy Measurement Submit Documentation Feedback Copyright © 2014, Texas Instruments Incorporated

description

ITS A SINGLE PHASE ENERGY MEASUREMENT METHOD DESCRIPTION ..

Transcript of 1ph Energy Measurements

  • UTXD0

    RS 232 BRIDGE

    V1-/Vref(O)

    SPI

    Vref(I)

    URXD0

    HF crystal

    8 MHzXT2 IN

    XT2 OUT

    Analog to Digital

    I In

    V In

    AC mains

    V1+I1+

    I1-

    N L

    RSTVSS

    VCC

    LOAD

    V1-VREF

    GPIOMSP430AFE

    SOMI SIMO

    APPLICATION PROCESSOR

    UART TO PC

    VCC

    GND

    VCC

    GND

    VCC

    GND

    SPI

    I/O I/O

    SPI

    MSP430AFE JTAG

    F663x JTAG

    Capacitive Power supply

    AC mainsL N

    MAX

    AB

    CkWhREACTEST kW

    MSP430F663x

    LCD DISPLAY

    ISOLATED AC/DC

    POWER SUPPLY

    USB

    USB COMM TO PC

    ELECTRICALISOLATION BOUNDARY

    Optical Digital Isolators

    WirelessDaughterCard EMK Interface

    20-pin

    20-pin

    SPI

    SCLK SCLK

    TI DesignsSingle-Phase Electric Meter with Isolated EnergyMeasurement

    TI Designs Design FeaturesTI Designs provide the foundation that you need Simplified Meter Calibration by Using USBincluding methodology, testing and design files to Connectionquickly evaluate and customize the system. TI Designs Isolated Communications Between Metrology AFEhelp you accelerate your time to market. and Host MCU

    TI Energy Library for Metrology Calculates AllDesign ResourcesEnergy Measurement Parameters

    Design PageTIDM-METROLOGY-HOST Host MCU Application Controls Onboard LCD andMeter CalibrationMSP430AFE253 Product Folder

    MSP430F6638 Product Folder Single-Phase Energy Measurement Achieves ClassISO7420 Product Folder 0.2 AccuracyISO7421 Product Folder Segment LCD on BoardTPS77033 Product Folder

    Featured ApplicationsTPD4E004 Product Folder Metering Street LightingASK Our E2E Experts

    WEBENCH Calculator Tools

    All trademarks are the property of their respective owners.

    1TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • System Description www.ti.com

    An IMPORTANT NOTICE at the end of this TI reference design addresses authorized use, intellectual property matters and otherimportant disclaimers and information.

    1 System DescriptionElectric meter developers often prefer to separate the energy measurement function from the hostprocessor functions such as ANSI/IEC data tables, DLMS/COSEM, tariff management, andcommunications. This design demonstrates a method for keeping these meter functions separated byusing the MSP430AFE253 as the metrology processor and the MSP430F6638 as the host processor. Thedesign also demonstrates how to isolate communications between the two processors to achieve thenecessary safety requirements. Finally, this design demonstrates a method for meter calibration using theUSB interface on the F6638 MCU.

    The MSP430AFE25x devices belong to the MSP430F2xx family of devices. These devices find theirapplication in energy measurement and have the necessary architecture to support it. TheMSP430AFE25x, mentioned as MSP430AFE from this point forward, has a powerful 12-MHz CPU withMSP430 architecture. The analog front end (AFE) consists of up to three analog-to-digital converters(ADC) based on a second-order sigma-delta architecture that supports differential inputs. The sigma-deltaADCs (SD24_A) have capabilities to output 24-bit results and can be grouped together for simultaneoussampling of voltage and currents on the same trigger. In addition, each has an integrated gainamplifier (with gains up to 32) for amplification of low-output sensors. A 1616-bit hardware multiplier onthis chip is used to further accelerate math intensive operations required for metrology parameters. Theprogrammable software on the MSP430AFE supports calculation of various parameters for single phaseenergy measurement with tamper detection. The key parameters calculated during energy measurementsare RMS current and voltage, active, reactive, and apparent power and energies, power factor, andfrequency.

    The MSP430F663x, the host processor in this two-chip architecture, has a powerful 20-MHz CPU with anMSP430 architecture. The MSP430F663x contains a full-speed Universal Serial Bus (USB), integratedLCD driver with contrast control for up to 160 segments, a hardware real-time clock with battery back-upsystem, multiple timers, and serial communication interfaces. With large a on-chip memory, this device isbest suited as an application processor to interface to any low-cost metrology processor such as theMSP430AFE. The host-processor related portions of this design are isolated from the metrology-processorrelated portions, thereby isolating the host processor from mains high voltage. Isolated inter-processorcommunication between the metrology and host processor is made possible using the ISO7420 andISO7421 isolators on the SPI/UART pins.

    This design guide has a complete metrology and application source code provided as a downloadable zipfile.

    2 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • 10

    u

    5.1

    V

    LL103A

    TPS77033

    DGND_AFE

    1uH

    1uH

    560R / 5W

    DN

    P(3

    .3V

    )

    DNP

    0.1u

    0.1

    u

    S20K

    275

    2200uF

    0

    910n / 400V

    C2

    3

    ZD

    2

    D10IN1

    /EN3 FB 4

    OUT 5

    GN

    D2

    IC3L5

    L6

    R22

    ZD

    1

    R23

    C2

    5

    C2

    6R1 C4

    R26

    C49

    DGND_AFE

    DGND_AFE

    U+LINE

    NEUTRAL

    LINE_A DVCC_PL

    ++V1

    CONNECT AGND and DGND

    www.ti.com Design Features

    2 Design FeaturesThis section describes the front-end passives and other components required for the design of an energymeter using the MSP430AFE.

    2.1 Hardware Implementation

    2.1.1 Power SupplyThe MSP430 family of microcontrollers support a number of low-power modes in addition to low-powerconsumption during active (measurement) mode when the CPU and other peripherals are active. Since anenergy meter is always interfaced to the AC mains, the DC supply required for the measuring element(MSP430AFE) can be easily derived using an AC-to-DC conversion mechanism.

    The reduced power requirements of this device family allow design of power supplies to be small,extremely simple, and cost-effective. The power supply allows the operation of the energy meter by beingpowered directly from the mains. The next sub-sections discuss the various power supply options that areavailable to users to support their design.

    2.1.1.1 Resistor Capacitor (RC) Power SupplyFigure 1 shows a simple capacitor power supply that supplies a regulated output voltage of 3.3 V usingthe mains AC voltage of 110 to 230 V.

    Figure 1. Simple Capacitive Power Supply for the MSP430 Energy Meter

    Appropriate values of resistor R22 and capacitor C49 are chosen based on the required output current-drive of the power supply. Voltage from mains is directly fed to a RC based circuit followed by arectification circuitry to provide a DC voltage for the operation of the MSP430. This DC voltage isregulated to 3.3 V for full speed operation of the MSP430. For the circuit above, the drive provided isapproximately 25 mA. The design equations for the power supply are given in the MSP Family Mixed-Signal Microcontroller Application Notes (SLAA024, Section 3.8.3.2). If an additional drive is required, useeither an NPN output buffer or a transformer- or switching-based power supply.

    3TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • 330k 330k 330k

    1K

    100

    1.5

    K 47pF

    47pF15nF

    GN

    D

    AGND_AFE

    0

    R38 R41 R44

    R47

    R50

    R53

    C13

    C14C41

    R24

    AGND_AFE

    V1+

    V1-

    V1

    NEUTRAL

    LINE_A

    S2

    0K

    27

    5

    15

    0u

    F

    0.1u

    SMAJ5.0ABCT

    4.7u/400V

    LL

    NN

    NCNC

    2626

    2222

    VO+VO+

    VO-VO-

    R5

    C3

    6

    C3

    7

    ZD

    3

    C38

    DGND_APP

    N_APP

    L_APP

    DVCC_APP_PL

    +

    Design Features www.ti.com

    2.1.1.2 Switching-Based Power SupplyWhen high current drive is required to drive RF transceivers, a simple capacitive power supply will notprovide enough peak-current. Therefore, a switching-based power supply is required. A separate powersupply module on the board may be used to provide 3.3-V DC from the AC mains of 110 to 230-V AC.Figure 2 shows the use of an SMPS module to provide a 3.3-V rail with increased current drive. Thismodule is used on the EVM430-AFE253 to provide an isolated voltage to drive only the MSP430F663xand its associated interfaces.

    Figure 2. Switching-Based Power Supply for the MSP430 Applications Processor

    2.1.2 Analog InputsThe MSP430AFEs AFE, which consists of the ADC, is differential and requires that the input voltagesat the pins do not exceed 500 mV (gain = 1). To meet this specification, the current and voltage inputsneed to be scaled down. In addition, since the SD24_A allows negative voltage of up to 1 V; AC mainssignals can be directly interfaced without the need for level shifters. This sub-section describes the AFEused for voltage and current channels.

    2.1.2.1 Voltage InputsThe voltage from the mains is usually 230 or 110 V and needs to be scaled down to a range of 500 mV.The AFE for voltage consists of spike protection varistors (not shown) followed by a simple voltage dividerand a RC low-pass filter that acts like an anti-alias filter.

    Figure 3. AFE for Voltage Inputs

    Figure 3 shows the AFE for the voltage inputs for a mains voltage of 230 V. The voltage is brought downto approximately 350 mVRMS, which is a 495-mV peak and fed to the positive input, adhering to theMSP430 analog limits. A common mode voltage of zero can be connected to the negative input of the.

    NOTE: The anti-alias resistors on the positive and negative sides are different because the inputimpedance to the positive terminal is much higher; therefore, a lower value resistor is usedfor the anti-alias filter. If this filter is not maintained, a relatively large phase shift would resultbetween voltage and current samples.

    4 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • 1N4148

    1N4148

    1N4148

    1N4148

    BLM21BD121SN1D

    BLM21BD121SN1D

    BLM21BD121SN1D

    BLM21BD121SN1D

    6.8

    1K

    1K

    6.8

    1K

    1K

    47pF

    47pF15nF

    47pF

    47pF

    15nF

    AGND_AFE

    GN

    DG

    ND

    GN

    D DN

    P0

    D22

    D23

    D24

    D25

    D26

    D27

    D28

    D29

    L15

    L16

    L17

    L18

    R16

    R17

    R18

    R19

    R20

    R21

    C17

    C18

    C30

    C31

    C33

    C34

    1 2JMP1

    11

    22

    11

    22

    R33

    R34

    I1+

    I1-

    IN+

    IN-

    AVCC_AFE

    AGND_AFE

    www.ti.com Design Features

    2.1.2.2 Current InputsThe AFE for current inputs is a little different from the AFE for the voltage inputs. Figure 4 shows the AFEused for current channel I1 and I2.

    Figure 4. AFE for Current Inputs

    Resistor R16 is the burden resistor that would be selected based on the current range used and the turns-ratio specification of the CT (not required if shunt resistors are used as current sensors). The value of theburden resistor for this design is around 6.8 . The anti-aliasing circuitry consisting of R and C follows theburden resistor. The input signal to the converter is a fully differential input with a voltage swing of 500-mV maximum with gain of the converter set to 1.

    2.2 Software ImplementationThe software for the implementation of one-phase metrology is discussed in this section. The first sub-section discusses the setup of various peripherals of the metrology and application processors. In thesecond sub-section, the metrology software is described as two major processes: the foreground processand background process. In the third sub-section, the application software is described in detail.Subsequently, the process of how the MSP430F663x receives metering parameters from the AFE isdescribed.

    2.2.1 Peripherals SetupThe major peripherals of the MSP430AFE are the 24-bit sigma delta (SD24_A) ADC, clock system,watchdog timer (WDT), and so on. For the MSP430F663x, the major peripherals of are the clock system,timer, USB, LCD, WDT, and SPI (USCI).

    5TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Design Features www.ti.com

    2.2.1.1 AFE SD24_A SetupThe MSP430AFE has up to three independent sigma delta data converters. For a single phase system, atleast two s are necessary to independently measure one voltage and current. The code accompanyingthis application note will address the metrology for a 1-phase system with limited discussion to anti-tampering. The clock to the SD24_A is derived from an external crystal 8-MHz external crystal (ACLK).The sampling frequency is defined as fs = fM / OSR, the OSR is chosen to be 256, and the modulationfrequency is chosen as 1 MHz, resulting in a sampling frequency of 3906 Hz. The SD24_As areconfigured to generate regular interrupts every sampling instant.

    The following are the channels associations: A0.0+ and A0.0: Current I1 A1.0+ and A1.0: Current I2 (Neutral) A2.0+ and A2.0: Voltage V1

    2.2.1.2 AFE Main Clock SetupThe MSP430AFE supports an external high-frequency crystal with frequencies of up to 12 MHz. In thisEVM, an 8-MHz crystal is used, and MCLK is sourced from this external crystal.

    2.2.1.3 AFE UART/SPI SetupThe MSP430F6638, the master, and MSP430AFE, the slave, communicate via SPI. In this application, theSPI is configured in 8-bit, 3-wire mode with SPI clock set at 1 MHz.

    2.2.1.4 F6638 Main Clock SetupThe MSP430F6638 supports external low-frequency or external high-frequency crystals. In this EVM, an8-MHz high frequency crystal is used and MCLK is sourced from this crystal. In addition, a low-frequency32,768-Hz crystal is used as ACLK to source the real time clock and LCD.

    2.2.1.5 F6638 Real-Time Clock (RTC_B)The RTC_B is a real-time clock module that is configured to give precise one-second interrupts. Based offthese one-second interrupts, the time and date are updated in the software as necessary.

    2.2.1.6 F6638 LCD Controller (LCD_B)The LCD controller on the MSP430F6638 can support up to 4-mux displays and 160 segments. In thecurrent design, the LCD controller is configured to work in 4-mux mode using 88 segments with a refreshrate set to ACLK/64, which is 512 Hz. For information about the parameters displayed on the LCD, seeSection 5.1.

    6 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • RESET

    Hardware setup:

    Clock, SD24_A, Port pins, Timer,

    USART

    Calculate RMS Current, RMS

    Voltage, Active Power, Apparent

    Power, Reactive Power,

    Frequency (Hz), and Power

    Factor

    1 second of Energy

    accumulated? Wait for

    acknowledgement from

    Background process

    Y

    N

    a. AFEENRDYFG set to indicate

    foreground process is complete

    b. Global flag AFEINTPENDING

    set to indicate changes to the

    metering status register

    www.ti.com Design Features

    2.2.2 Metrology Foreground ProcessThe metrology foreground process includes the initial setup of the MSP430AFE hardware and softwareimmediately after a device reset. Figure 5 shows the flowchart for this process.

    Figure 5. Metrology Foreground Process

    The setup routines involve the initialization of the ADC, clock system, general purpose input/output (I/Oport) pins, timer, and the USART SPI communication. The MSP430AFE is configured as an 8-bit, 3-wireSPI slave.

    NOTE: Since the USART is configured for SPI, the RS-232 communication using UART cannot beused simultaneously.

    After the hardware is setup, the foreground process waits for the background process to notify it tocalculate new metering parameters. This notification is done through a status flag every time a frame ofdata is available for processing. The data frame consists of processed current, voltage, active, andreactive quantities accumulated for one second. This frame is equivalent to accumulation of 50 or 60cycles of data synchronized to the incoming voltage signal. In addition, a sample counter keeps tracks ofhow many samples have been accumulated over this frame period. This count can vary as the softwaresynchronizes with the incoming mains frequency.

    7TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • ACT,ph ACT,ph

    REACT,ph REACT,ph

    E P Sample count

    E P Sample count

    =

    =

    Sample Samplecount count

    ph 90 ph

    n 1 n 1ACT,ph ACT,ph REACT,ph REACT,ph

    v(n) i (n) v (n) i (n)

    P K P KSample count Sample count

    = =

    = =

    Sample Samplecount count

    ph ph

    n 1 n 1RMS v RMS,ph i,ph

    v(n) v(n) i (n) i (n)

    V K I KSample count Sample count

    = =

    = =

    Design Features www.ti.com

    All values are accumulated in separate 48-bit registers to further process and obtain the RMS and meanvalues during the foreground process. Using the foregrounds calculated values of active and reactivepower, the apparent power is calculated. The frequency (in Hertz) and power factor are also calculatedusing parameters calculated by the background process and the formulas in Section 4.3. After all themetering parameters are calculated, the AFEENRDYFG metering interrupt flag is asserted high to indicatethe completion of the foregrounds calculation of the metrology parameters for the current frame.

    2.2.2.1 FormulaeThis section briefly describes the formulae used for the voltage, current, and energy calculations. Asdiscussed in the previous sections, simultaneous voltage and current samples are obtained from threeindependent converters at a sampling rate of 3906 Hz. Track of the number of samples that arepresent in one second is kept and used to obtain the RMS values for voltage and for each current via thefollowing formulas:

    where ph = Live or Neutral v(n) = Voltage sample at a sample instant n iph(n) = Each current sample at a sample instant n Sample count = Number of samples in one second Kv = Scaling factor for voltage Ki,ph = Scaling factor for line or neutral current (1)

    Power and energy are calculated for a frames worth of active and reactive energy samples. Thesesamples are phase corrected and passed on to the foreground process, which uses the number ofsamples (sample count) to calculate total active and reactive powers via the following formulas:

    where v90(n) = Voltage sample at a sample instant n shifted by 90 degrees KACT,ph = Scaling factor for active power KREACT,ph = Scaling factor for reactive power (2)

    Active energy is calculated from the active power by the following equations:

    (3)

    For reactive energy, the 90 phase shift approach is used for two reasons:1. The approach allows accurate measurement of the reactive power for very small currents.2. The approach conforms to the measurement method specified by IEC and ANSI standards.

    The calculated mains frequency is used to calculate the 90-shifted voltage sample. Since the frequencyof the mains varies, first measure the mains frequency accurately to phase shift the voltage samplesaccordingly (see Section 2.2.3.3).

    Implementing the applications phase shift consists of an integer part and a fractional part. The integer partis realized by providing an n samples delay. The fractional part is realized by a fractional delay filter (seeSection 2.2.3.2).

    8 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Act

    Apparent

    Act

    Apparent

    P, if capacitive load

    PInternalRepresentation of Power Factor

    P, if inducitive load

    P

    = -

    SamplingRateFrequency (Hz)

    Frequency=

    2 2APP,ph ACT,ph REACT,phP P P= +

    www.ti.com Design Features

    After calculating the active and reactive power, the apparent power is calculated by the following formula:

    (4)

    The background process calculates the frequency in terms of samples per mains cycle. The foregroundprocess then converts this to Hertz by the following formula:

    where Sampling rate in units of samples per second Frequency in units of samples per mains cycle (5)

    After the active and apparent powers have been calculated, the absolute value of the power factor iscalculated. In the meters internal representation of power factor, a positive power factor corresponds to acapacitive load and a negative power factor corresponds to an inductive load. The sign of the internalrepresentation of power factor is determined by whether the current leads or lags voltage, which isdetermined in the background process. Therefore, the internal representation of power factor is calculatedby the following formula:

    (6)

    2.2.3 Metrology Background ProcessThe metrology background process uses the interrupt as a trigger to collect voltage and currentsamples (up to three values). These samples are used to calculate intermediate results in dedicated 48-bitaccumulation registers for parameters explained in Section 4.2. The background function deals mainlywith time critical events in software. Once sufficient samples (one second's worth) have beenaccumulated, the foreground process is triggered to calculate final values of VRMS, IRMS, active, reactiveand apparent powers, active, reactive and apparent energy, frequency, and power factor. The backgroundprocess is also wholly responsible for the calculation of energy proportional pulses, frequency (in samplesper cycle), and the sign of the power factor. Figure 6 shows the flow diagram of the background process.

    9TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • SD24 Interrupts @

    3906/sec

    Read Voltage V1

    Read Currents I1, and I2

    a. Remove residual DC

    b. Accumulate samples for instantaneous

    Power

    c. Accumulate for IRMS for both currents and

    VRMSd. Calculate frequency in samples per

    second

    e. Keep track of whether current leads or

    lags voltage

    Store readings and notify

    foreground process

    Pulse generation based on

    power accumulation threshold

    Return from

    Interrupt

    1 second of energy

    calculated?N

    Y

    Interrupt MSP430F6638 and

    clear AFEINTPENDING flag

    AFEINTPENDING

    flag asserted?N

    Y

    Design Features www.ti.com

    Figure 6. Background Process

    The following sections discuss the various elements of electricity measurement in the backgroundprocess.

    10 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • in inDeg

    s m

    360 f 360 fDelay resolution

    OSR f f

    = =

    Conversion

    32

    SD24OSRx = 32

    Load SD24PREx

    SD24PREx = 8Preload

    Applied Time

    Delayed Conversion

    40

    Delayed Conversion

    Result

    Conversion

    32fM cycles:

    www.ti.com Design Features

    2.2.3.1 Voltage and Current SignalsThe converter has a fully differential input architecture, and each pin can accept negative inputs;therefore, no level-shifting is necessary for the incoming AC voltage (unlike single-ended or pseudo-differential converters).

    The output of each is a signed integer and any stray DC or offset value on these s are removedusing a DC tracking filter in software. Separate DC estimates for voltage and current are obtained usingthe filter for voltage and current samples respectively. This estimate is then subtracted from subsequentvoltage and current samples.

    The resulting instantaneous voltage and current samples are used to generate the following intermediateresults: Accumulated squared values of voltage and current, which is used for VRMS and IRMS calculations,

    respectively. Accumulated energy samples to calculate active energy. Accumulated energy samples using current and 90 phase-shifted voltage to calculate reactive energy.

    These accumulated values are processed by the foreground process.

    2.2.3.2 Phase CompensationWhen a current transformer (CT) is used as a sensor, it introduces a phase shift between the current andvoltage signals. Also, the voltage and current input circuits passive components may introduce anotherphase shift. The relative phase shift between voltage and current samples need to be compensated toensure accurate measurements. The converters have programmable delay registers (SD24PREx) thatcan be applied to a particular channel. This built-in feature (PRELOAD) is used to provide the phasecompensation required. Figure 7 shows the usage of PRELOAD to delay sampling on a particularchannel.

    Figure 7. Phase Compensation Using PRELOAD Register

    The fractional delay resolution is a function of input frequency (fin), OSR, and the sampling frequency (fs).

    (7)

    In this application, for an input frequency of 60 Hz, OSR of 256, and sampling frequency of 3906, thePRELOAD register resolution (one step) is about 0.02 and the maximum PRELOAD delay (a maximum of255 steps) is 5.25. When using CTs that provide a larger phase shift than this maximum, entire sampledelays along with fractional delay must be provided. This phase compensation can also be modified onthe fly to accommodate temperature drifts in CTs, but one must ensure that the conversions on the have been stopped.

    11TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • noise corrupted samples

    good samples

    linear interpolation

    Design Features www.ti.com

    2.2.3.3 Frequency Measurement and Cycle TrackingThe instantaneous current and voltage samples for each phase are accumulated in 48-bit registers. Acycle-tracking counter and sample counter keep track of the number of samples accumulated. Whenapproximately one seconds worth of samples have been accumulated, the background process storesthese 48-bit registers and notifies the foreground process to produce the average results such as RMSand power values. Cycle boundaries are used to trigger the foreground averaging process since itproduces very stable results.

    For frequency measurements, do a straight-line interpolation between the zero crossing voltage samples.Figure 8 depicts the samples near a zero cross and the process of linear interpolation.

    Figure 8. Frequency Measurement

    Since noise spikes can cause errors, the application uses a rate-of-change check to filter out the possibleerroneous signals and make sure points interpolated are from genuine zero-crossing points. For example,with two negative samples, a noise spike can make one of them positive and, therefore, make thenegative and positive pairs look as if there is a zero crossing.

    The resultant cycle-to-cycle timing goes through a simple low-pass filter to further smooth out cycle-to-cycle variations. This results in a stable and accurate frequency measurement tolerant of noise.

    2.2.3.4 LED Pulse GenerationIn electricity meters, the energy consumed is normally measured in fraction of kilowatt hour (KWh) pulses.This information can be used to accurately calibrate any meter or for accuracy measurement. Typically,the measuring element (MSP430) is responsible to generate pulses proportional to the energy consumed,typically defined as pulses per kWh. To serve both these tasks efficiently pulse generation has to beaccurate with relatively little jitter. Although, time jitters are not an indication of bad accuracy, they wouldgive a negative indication on the overall accuracy of the meter. Therefore, the jitter has to be averagedout.

    This application uses average power to generate these energy pulses. The average power (calculated bythe foreground process) is accumulated every interrupt, spreading the accumulated energy from theprevious one-second time frame evenly for each interrupt in the current one-second time frame. This timeframe is equivalent to converting power to energy. Once the accumulated energy crosses a threshold, apulse is generated. The amount of energy above this threshold is kept and new energy value is added ontop of it in the next interrupt cycle. Since the average power tends to be a stable value, this way ofgenerating energy pulses is very steady and free of jitter.

    12 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • 11-KWhThreshold 1KW Number of interrupts per second Number of seconds per hour

    .01

    100,000 3906 3600 0x14765AAD400

    =

    = =

    SD interrupts @

    3906 Hz

    Energy

    Accumulator+=

    Average Power

    Energy Accumulator>1 tick?

    Energy Accumulator =

    Energy Accumulator 1 tick

    Generate1 pulse

    Proceed to other

    tasks

    Y

    N

    www.ti.com Design Features

    The threshold determines the energy tick specified by meter manufacturers and is a constant. The tick isusually defined in "pulses per kWh or just in KWh. One pulse's needs to beg generates for every energytick. For example, in this application, the number of pulses generated per KWh is set to 1600 for activeand reactive energies. The energy tick in this case is 1 KWh per 1600 pulses. Energy pulses aregenerated and available on a header and also through LEDs on the board. General purpose I/O pins areused to produce the pulses. The number of pulses per kWh and each pulse-width can be configured in thesoftware. Figure 9 shows the flow diagram for pulse generation.

    Figure 9. Pulse Generation for Energy Indication

    In this application, the average power is represented in units of 0.01 W; therefore, the corresponding valueof the 1-KWh threshold is defined as:

    (8)

    13TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • RESET

    Peripheral Setup:

    Clock,, Port pins, Timers, USB, LCD, USCI

    2 seconds passed since

    last LCD update?

    Y

    N

    a. Update LCD display to new

    metering parameter

    b. Send latest active power

    readings to CC2530

    Received port interrupt

    from AFE?

    Y

    N

    Send request to the AFE to send

    its metering-interrupt flags

    Received a complete

    packet from the AFE?

    Y

    N

    Decode the received packet and

    take the proper action

    depending on what is received

    GUI requested

    calibration factors?

    Y

    N

    Read calibration factors from

    the AFE and send it to the GUI

    GUI requested

    configuration

    information?

    YRead configuration information

    from the AFE and send it to the

    GUI

    Notified by AFE that

    any of the metering-interrupt

    flags are asserted?

    Y

    Call corresponding function for

    each metering-interrupt flag

    that is asserted.

    GUI requested to

    change calibration

    factor values?

    Y

    Send new calibration factors to

    the AFE

    N

    N

    N

    Design Features www.ti.com

    2.2.4 Application Processor SoftwareThe application processor is a proxy between the AFE and various types of external communication andLCD display. It is responsible for responding to port (I/O) and SPI (receive) interrupts from the AFE andUSB interrupts from a PC GUI. Figure 10 shows the flowchart of the main components of the software thatruns on the MSP430F663x.

    Figure 10. Application Software

    After a device reset, the MSP430F663x sets up the peripherals and initializes the CPU and SMCLK clock(at 8 MHz), port pins, timers, USB, USCI, and LCD. One USCI module is configured for SPIcommunication to the MSP430AFE and another module is configured for UART for wirelesscommunication. In this application, the USCI module for SPI communication is configured as a 3-pin, 8-bitSPI master with a SPI clock of 1 MHz. The USCI module that is configured for UART communication isconnected to a ZigBee network processor (CC2530) and is configured for 8N1 with a baud rate of 115200.

    14 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • ForegroundBackground

    Has F6638

    requested all

    the metering parameters

    from AFE?

    After a second of

    samples, background

    tells the foreground

    that the metering

    parameters are ready

    to be calculated.

    Foreground sets

    AFEENRDYF and

    AFEINTPENDING flags

    to signify that new

    emeter parameters

    have been calculated.

    When the background

    sees that the

    AFEINTPENDING flag is

    set, it outputs a pulse

    }vZ^&_/Ed_]v.

    The flag is then cleared.

    The pulse on AFE_INT

    triggers the F6638 port

    interrupt, which lets

    the F6638 know that

    the AFE has requested

    an interrupt.

    Once the F6638 knows that

    the AFE requested an

    interrupt, it sends a SPI

    command to the AFE for it to

    send the values of the

    metering-interrupt flags.

    AFE receives this

    request and sends the

    metering-interrupt

    flags via SPI. After

    sending the flags, they

    are cleared.

    F6638 receives the

    metering-interrupt

    flags and sees that

    AFENRDYF is asserted

    which means new

    meter parameters have

    been calculated.

    AFE receives request

    and sends requested

    metering parameter via

    SPI

    Request the next parameter

    via SPI

    NN

    Receive and store

    metering parameter

    All Metering Parameters

    Received

    YY

    MSP430AFE MSP430F6638

    Foreground calculates

    metering paramters

    based on the values

    from the background.

    www.ti.com Design Features

    Once the hardware has been configured, the MSP430F663x enters a while loop. At the beginning of eachiteration of the loop, a timer flag is checked to determine the start of a new 2-second interval. Every two-second interval, the LCD display is updated with a different metering parameter. Additionally, updatedactive power readings received from the MSP430AFE are sent to a RF transceiver (CC2530, configuredas transmitter). Section 2.2.5 discusses how the MSP430F663x receives the active power readings andother metering parameters from the MSP430AFE.

    After determining if it is a new two-second interval, as shown in Figure 10, appropriate actions are taken.

    2.2.5 Transferring New E-Meter Parameters from AFE to MSP430F663xAlthough the MSP430F663x calls a function for each asserted metering-interrupt flag, only one of thesefunctions actually has code to deal with its corresponding metering-interrupt flag being asserted. Thisfunction deals with the case the AFE has just calculated new e-meter parameters and has alerted theMSP430F663x via the corresponding metering-interrupt flag. For the other functions, the user may addcode to customize the performed actions for each metering interrupt. Figure 11 shows the process used tocalculate the metering parameters and transfer the newly calculated parameters from the AFE to theMSP430F663x.

    Figure 11. Transference of Meter Parameters from AFE to MSP430F663x

    15TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • UTXD0

    RS 232 BRIDGE

    V1-/Vref(O)

    SPI

    Vref(I)

    URXD0

    HF crystal

    8 MHzXT2 IN

    XT2 OUT

    Analog to Digital

    I In

    V In

    AC mains

    V1+I1+

    I1-

    N L

    RSTVSS

    VCC

    LOAD

    V1-VREF

    GPIOMSP430AFE

    SOMI SIMO

    APPLICATION PROCESSOR

    UART TO PC

    VCC

    GND

    VCC

    GND

    VCC

    GND

    SPI

    I/O I/O

    SPI

    MSP430AFE JTAG

    F663x JTAG

    Capacitive Power supply

    AC mainsL N

    MAX

    AB

    CkWhREACTEST kW

    MSP430F663x

    LCD DISPLAY

    ISOLATED AC/DC

    POWER SUPPLY

    USB

    USB COMM TO PC

    ELECTRICALISOLATION BOUNDARY

    Optical Digital Isolators

    WirelessDaughterCard EMK Interface

    20-pin

    20-pin

    SPI

    SCLK SCLK

    Block Diagram www.ti.com

    3 Block DiagramFigure 12 shows a high-level system block diagram of the reference EVM (EVM430-AFE253) from TexasInstruments, which is divided into a metrology portion that has the MSP430AFE and the applicationportion that has the MSP430F663x. The MSP430AFE is a slave metrology processor and theMSP430F663x is the host/application processor. Isolated inter-processor communication is made possibleusing digital isolators on the SPI/UART pins.

    Figure 12. EVM430-MSP430AFE253 System Block Diagram

    16 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • UART

    V1-/

    Vref(O) SPIVref(I)

    HF crystal

    (Up to 12 MHz)

    XT2IN

    XT2OUT

    Analog to

    Digital

    I In

    V In

    From utility

    C

    T

    V1+

    I1+

    I1-

    I2+

    I2-

    N L

    RST

    VSS

    VCC MSP430

    AFE2x3

    Application

    interface

    LOAD

    V1-

    VREF

    PULSE1

    PULSE2

    www.ti.com Block Diagram

    Figure 13 shows the high level interface with MSP430 used for a single-phase energy meter application. Asingle-phase, two-wire connection to the mains is shown in this case with tamper detection. Currentsensors are connected to each of the current channels and a simple voltage divider is used forcorresponding voltages. The CT has an associated burden resistor that must be connected at all times toprotect the measuring device. The choice of the CT and the burden resistor is done based on themanufacturer and current range required for energy measurements. The choice of the shunt resistor valueis determined by the current range, gain settings of the SD24_A on the AFE and the tolerance of thepower dissipation. The choice of voltage divider resistors for the voltage channel is selected to ensure themains voltage is divided down to adhere to the normal input ranges that are valid for the MSP430SD24_A. Refer to the MSP430x2xx users guide and MSP430AFE datasheet for these limits.

    Figure 13. Single-Phase, Two-Wire Connection Using MSP430AFE2x3

    17TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • LCD

    RFConnector

    AFE JTAG

    Isolated Supplyon Bottomof Board

    Analog Front End

    Capacitive Supply(Some portionslocated on bottomof board)

    Isolated RS-232

    F6638

    F6638 USB

    F6638 JTAG

    Reactive Pulse

    Active Pulse

    F6638-AFEIsolators

    AFE253

    Energy Meter Demo www.ti.com

    4 Energy Meter DemoThe following figures of the EVM best describe the hardware. Figure 14 is the top view of the energy meter. Figure 15 then shows the location ofvarious pieces of the EVM.

    Figure 14. Top View of the EVM Figure 15. Top View of the EVM with Blocks and Jumpers

    18 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • www.ti.com Energy Meter Demo

    4.1 Connections to the Test Setup or AC Voltages

    NOTE: This is a single-phase system and any reference to secondary currents and voltages shouldnot be confused with a dual-phase system.

    AC voltage or currents can be applied to the board for testing purposes at these points: Pads L1 and N1 correspond to the line and neutral voltage inputs. The EVM can measure up to 230-V

    AC, 50 or 60 Hz from the AC line. This line voltage can also be used to power the MSP430AFE fromAC mains.

    Pads CUR1+ and CUR1, which are the current inputs after the sensors (secondary AC current for CTor AC voltage across shunt). Care must be taken that the AC peak amplitude fed to the corresponding not exceed 500 mV.

    CUR2+ and CUR2 can also be used as current inputs to measure another current (typically used tomeasure return current for tamper detection). Care must be taken that the AC peak amplitude fed tothe corresponding not exceed 500 mV.

    Pads L2 and N2 correspond to the same Line and Neutral voltage inputs. The AC mains line andneutral voltages should be connected to these pads to provide isolated power to the hostMSP430F6638 and its associated components. On this EVM, this connection has not been made.

    Figure 16 and Figure 17 shows the various connections that need to be made to the test set up for properfunctionality of the EVM.

    Figure 16. Top View of the EVM with Test Setup Figure 17. Side View of the EVM with Test SetupConnections Connections

    19TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Energy Meter Demo www.ti.com

    With an AC test setup, the connections have to be made according to Figure 16 and Figure 17 that showthe connections from the top and side view respectively. L and N correspond to the voltage inputs fromthe AC test setup. I+ and I corresponds to one set of current inputs and I+ and I corresponds to thesecond set of current inputs.

    Although the EVM hardware and software support measurement for the second current, the EVM obtainedfrom Texas Instruments does not have the second sensor. The current outputs from the AC test sourcemust be connected to I+ and I only. If an additional sensor needs to be placed, use the two bottom leftslots corresponding to terminals I+ and I. Additional wired connections need to be made to connect theoutput of these sensors to points CUR2+ and CUR2 on the EVM.

    20 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • www.ti.com Energy Meter Demo

    4.2 Jumper Settings

    Table 1. Header Names and Jumper Settings on the EVM

    NAME TYPE MAIN FUNCTIONALITY VALID USE-CASE COMMENTSThis header is notProbe here for active isolated from AC voltageenergy pulses. The pin so do not connectunder the "ACT" labelActive Energy Pulses + measuring equipmentsACT 2-pin header corresponds to theGND (WARNING) unless isolators externalActive Energy Pulse and to the EVM arethe other pin available. See HDR1corresponds to ground. instead.The SPI pins on thisheader are interfaced tothe MSP430F663x viaon board isolators(ISO1/ISO2/ISO3). The

    This contains the SPI UART pins correspondand UART lines of the to the UART signals andMSP430AFE isolated are not the associatedfrom the MSP430F6638. translated RS-232

    Communication header This header also signals; therefore, theyCOMMS 42-pin header for MSP430AFE contains the non- have UART voltage

    (WARNING) isolated active and levels and not RS232reactive energy pulse voltage levels. Do notoutputs (Duplicated on connect the active andACT and REACT reactive pulse pins onheaders). this header to a scope

    or other measuringequipment if externalisolators are not present.See HDR1 and HDR2instead.The SPI pins on thisheader are interfaced tothe MSP430AFE via onboard isolatorsThis contains the SPI (ISO1/ISO2/ISO3). Thelines and the application APP_INT is an isolatedinterrupt pin (APP_INT)Communication header input from theCOMMS_APP 42-pin header and other signalsfor MSP430F663x MSP430AFE used toconnected to the RF alert the MSP430F6638connector: RF_GPIO1, that updated meteringRF_GPIO2, and SFD. parameters are ready.All pins on this headerare isolated from the ACmains

    Probe here for GNDvoltage of theMSP430AFE Do not probe here if the

    Ground voltage header (DGND_AFE). Connect MSP430AFE isDGND1 Header for MSP430AFE negative terminal of connected to AC mains

    (WARNING) bench or external power unless when using ansupply when powering isolated AC test setup.the MSP430AFEexternally.Probe here for GNDvoltage of theMSP430F663x Note that DGND_APP is(DGND_APP). ConnectGround Voltage Header not isolated with USBDGND2 Header negative terminal offor MSP430F663x GND voltages on thebench or external power EVM.supply when poweringthe MSP430F663xexternally.

    21TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Energy Meter Demo www.ti.com

    Table 1. Header Names and Jumper Settings on the EVM (continued)NAME TYPE MAIN FUNCTIONALITY VALID USE-CASE COMMENTS

    Probe here for VCCsupply voltage of theMSP430AFE Do not probe here if the

    VCC Voltage Header for (DVCC_AFE). Connect MSP430AFE isDVCC1 Header MSP430AFE positive terminal of connected to AC mains

    (WARNING) bench or external power unless when using ansupply when powering isolated AC test setup.the MSP430AFEexternally.Probe here for VCCsupply voltage of theMSP430F663x Note that DGND_APP isVCC Voltage Header for (DVCC_APP). Connect not isolated with USBDVCC2 Header MSP430F663x positive terminal of GND voltages on the(WARNING) bench or external power EVM.supply when poweringthe MSP430F663xexternally.

    This is isolated from ACmains voltage so it issafe to connect a scopeIsolated Active Energy Probe here for isolatedHDR1 Header or other measuringPulses active energy pulses. equipments sinceisolators are alreadypresent on the EVM.This is isolated from ACmains voltage so it issafe to connect a scopeIsolated Reactive Probe here for reactiveHDR2 Header or other measuringEnergy Pulses energy pulses. equipments sinceisolators are alreadypresent on the EVM.Conditions based onPlace a jumper here to sensor:reference the negative"CUR2" Current Sensor CT: Always have aJMP1 Jumper terminal of the "CUR2"Reference jumper to analog ground Shunt: Do not connect a(AGND_AFE). jumperSee Section 4.3 forJTAG Power Selection Jumper placed duringJTG_PWR1 Jumper configurationfor MSP430AFE JTAG programming. information.See Section 4.3 forJTAG Power Selection Jumper placed duringJTG_PWR2 Jumper configurationfor MSP430F663x JTAG programming. information.

    Jumper placed whenpowering thePower Option Select for See Section 4.3 forPWR1 Jumper MSP430AFE either viaMSP430AFE configuration informationAC mains or externalpower.Jumper placed when

    Power Option Select for powering the See Section 4.3 forPWR2 Jumper MSP430F663x MSP430F663x either via configuration informationmains or external power.

    This header is notProbe here for reactive isolated from AC voltageenergy pulses. The pin so do not connectnext to the LEDReactive Energy Pulses measuring equipmentsREACT Header corresponds to the+ GND (WARNING) unless isolators externalReactive Energy Pulse to the EVM arepin and the other pin available. See HDR2corresponds to ground. instead.

    22 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • www.ti.com Energy Meter Demo

    4.3 Power Supply OptionsThe EVM can be configured to operate with different sources for power specific to the MSP430AFE andthe MSP430F663x. The various sources of power to the MSP430s are JTAG, AC mains voltage, andexternal bench supply and battery. Table 2 lists the header settings for the power options of theMSP430AFE only.

    Table 2. AFE Power Selection Headers

    POWER OPTION JTG_PWR1 PWR1Jumper on bottom two pins when board isJTAG No jumperoriented as in Figure 16

    AC Mains Voltage No jumper if debugging is not desired. Jumper on [1-2]Do not debug using JTAG unless ACsource or JTAG is isolated from each

    (WARNING) other. Jumper on the top two pins (whenthe board is oriented as shown inFigure 16) if debugging is desired.No jumper if debugging is not desired;Jumper on the top two pins (when theExternal bench supply/battery Jumper on [2-3]board is oriented as shown in Figure 16) ifdebugging is desired.

    When powered by the AC mains voltage, the PWR1 header can also be treated as a current consumptionheader by placing an ammeter across it.

    Table 3 lists the header settings for the power options of the MSP430F663x only.

    Table 3. F663x Power Selection Headers

    POWER OPTION JTG_PWR2 PWR2JTAG Jumper on [1-2] No jumper

    No jumper if debugging is not desired;AC Mains voltage Jumper on [1-2]Jumper on [2-3] if debugging is desired.No jumper if debugging is not desired;External bench supply/battery Jumper on [2-3]Jumper on [2-3] if debugging is desired.

    USB power R15 must be populated (default) Jumper on [2-3]

    When powered by the mains supply, PWR2 header can also be treated as a current consumption headerby placing an ammeter across it.

    23TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Results and Calibration www.ti.com

    5 Results and CalibrationWhen the MSP430F6638 and MSP430AFE are turned on, the results will be available through LCD andthe PC GUI.

    5.1 Viewing Results via LCDTable 4 shows the different metering parameters that are displayed on the LCD. If the AFE is not turnedon, then the metering parameters (with the exception of day and time) will not be updated from theirrespective initial values. The initial values for the metering parameters are shown in the Initial LCD Valuecolumn of Table 4. The LCD display scrolls between metering parameter every two seconds. Todistinguish metering parameters from each other, one or two characters are displayed on the LCD to theleft of the actual reading. The Symbol column shows which characters correspond to which meteringparameter. The Comments column provides a brief interpretation of the displayed metering parameters.

    Table 4. LCD Metering Parameters

    PARAMETER NAME SYMBOL UNITS INITIAL LCD VALUE COMMENTS

    Voltage Volts (V) 0.08

    The ':' symbolCurrent Amps (A) 0.009 represents the decimal

    point '.'

    Frequency Hertz (Hz) 0

    Active Power Watt (W) 0

    Every 10 ticksTotal consumed Active 100 Tick 0 increments the tenthsEnergy place by 1.

    Year/Month/DayDate 110321 (yymmdd)

    Hour/Minute/SecondTime 10203 (hhmmss)

    Volt-Ampere ReactiveReactive Power 0 (var)

    Apparent Power Volt-Ampere (VA) 0

    The characters

    are used if theload is determined to bea capacitive load.Constant between 0 andPower Factor 0 The characters1

    are used if theload is determined to bean inductive load.

    24 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • www.ti.com Results and Calibration

    5.2 Viewing Results via GUITo open the GUI, follow these steps:1. Once the MSP430F663x is turned on and the EVMs USB connector is connected to the PC, open the

    device manager to find the COM port assigned to the EVM. In this example, COM19 is used.2. Enter the /Source/GUI folder and open calibration-config.xml in a text editor.3. Change the port name field within the tag to the COM port of the meter. In Figure 18, this field

    is changed to COM19.

    Figure 18. GUI Config File Changed with to EVM COM Port

    4. Open calibrator.exe, which is located in the /Source/GUI folder. If the COM port in calibration-config.xml was changed in the previous step to the com port of the enumerated EVM, the GUI shouldpop up.

    Under correct connections, a top-left button will be green. If there are problems with connections or if thecode is not configured correctly, the button will be red. Once the GUI is executing, the results can beviewed by pressing the green button as shown in Figure 19.

    Figure 19. GUI Startup Window

    25TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Results and Calibration www.ti.com

    Once the green button is clicked, the results window pops up, as shown in Figure 20. Note that, unlike theLCD, the GUI power factor is displayed as a constant from 0 to 10 instead of a constant from 0 to 1. Also,there is a trailing 'L' or 'C' to indicate an inductive or capacitive load respectively.

    Figure 20. Results Window

    26 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • 47k

    1K

    1K

    DVCC_AFE

    10u

    0.1u

    10u

    0.1u

    AGND_AFE

    AVCC_AFE

    DGND_AFE

    10

    12

    pF

    12

    pF

    DGND_AFE

    XT

    2

    1N4148

    1N4148

    1N4148

    1N4148

    BLM21BD121SN1D

    BLM21BD121SN1D

    BLM21BD121SN1D

    BLM21BD121SN1D

    6.8

    1K

    1K

    6.8

    1K

    1K

    47pF

    47pF15nF

    47pF

    47pF

    15nF

    AGND_AFE

    GN

    DG

    ND

    GN

    D DN

    P0

    330k 330k 330k

    1K

    100

    1.5

    K 47pF

    47pF15nF

    GN

    D

    AGND_AFE

    10

    u

    5.1

    V

    LL103A

    TPS77033

    DGND_AFE

    1uH

    1uH

    560R / 5W

    DN

    P(3

    .3V

    )

    DNP

    0.1u

    0.1

    u

    0

    TIL191

    TIL191

    1K

    1K

    DVCC

    DVCC

    S2

    0K

    27

    5

    22

    00

    uF

    0.1u

    AGND

    0

    910n / 400V

    2.2n

    DGND_AFE

    F09HPDGND_AFE

    -

    DV

    CC

    _A

    FE

    DV

    CC

    _A

    FE

    BC

    86

    0B

    /BC

    85

    7B

    DN

    P

    1k

    10

    k

    1.5k

    22

    0

    1k

    68

    2.2k

    2.2k

    DGND_AFE

    0.1u

    0.1

    u

    BC860B/BC857B

    LL

    10

    3A

    LL

    10

    3A

    LL103A

    LL103A

    PS8802

    PS8802

    10u

    10u

    RS232

    135

    246

    7911

    8101214 13

    JTAG1

    123

    JT

    G_

    PW

    R1

    R61

    LE

    D1

    LE

    D2

    R7

    2

    R7

    3

    3 124

    S4

    123456789101112 13

    1415161718192021222324A0.0+

    A0.0-

    A1.0+

    A1.0-

    AVCC

    AVSS

    VREF

    A2.0+

    A2.0-

    TEST/SBWTCK

    RST/NMI/SBWTDIO

    P1.0/SVSIN/TACLK/SMCLK/TA2 DVSS

    P2.6/XT2IN

    P2.7/XT2OUT

    DVCCP1.1/TA1/SDCLK

    P1.2/TA0/SD0DO

    P1.3/UTXD0/SD1DO

    P1.4/URXD0/SD2DO

    P1.5/SIMO0/SVSOUT/TMS

    P1.6/SOMI0/TA2/TCK

    P1.7/UCLK0/TA1/TDO/TDI

    P2.0/STE0/TA0/TDI/TCLK

    C9

    C10

    C11

    C12

    R2

    C1

    6C

    19

    XT

    2

    1 2

    ACT

    1 2

    REACT

    1 23 45 67 8

    COMMS

    1 2 3 4

    DVCC1

    1 2 3 4

    DGND1

    D22

    D23

    D24

    D25

    D26

    D27

    D28

    D29

    L15

    L16

    L17

    L18

    R1

    6

    R17

    R18

    R1

    9

    R20

    R21

    C17

    C18

    C30

    C31

    C33

    C34

    1 2JMP1

    11

    22

    11

    22

    R3

    3R

    34

    R38 R41 R44

    R47

    R50

    R5

    3

    C13

    C14C41

    C2

    3

    ZD

    2

    D10IN1

    /EN3 FB 4

    OUT 5

    GN

    D2

    IC3L5

    L6

    R22

    ZD

    1

    R23

    C2

    5

    C2

    6

    R24

    1

    2 3

    4

    OK1

    1

    2 3

    4

    OK2

    12

    HD

    R1

    12

    HD

    R2

    R75

    R76

    R1 C4

    C1

    123P

    WR

    1

    R26

    C49

    C27

    162738495

    G1

    G2

    CON1

    R2

    7

    T1

    R2

    8

    R29

    R3

    0

    R31

    R3

    2

    R36

    R37

    R39

    R40

    C53

    C5

    4

    T2

    D1

    D3

    D4

    D7

    2

    3

    78

    5

    6

    U2

    2

    3

    78

    5

    6

    U5

    C15

    C22

    TCK_AFE

    TCK_AFERESET_AFEDVCC_AFE

    DVCC_AFE

    DVCC_AFE

    DVCC_AFE

    DVCC_AFE

    DVCC_AFE

    DVCC_AFE

    DVCC_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    I1+

    I1+

    I1-

    I1-

    IN+

    IN+

    IN-

    IN-

    AVCC_AFE

    AVCC_AFE

    AVCC_AFE

    AGND_AFE

    AGND_AFE

    AGND_AFE

    AGND_AFE

    VREF

    VREF

    XT2IN

    XT2IN

    XT2OUT

    XT2OUT

    UART_RX

    UART_RX

    UART_RX

    UART_TX

    UART_TX

    UART_TX

    SPI_CLK

    SPI_CLK

    SOMI

    SOMI

    SIMO

    SIMO

    SPI_CS

    SPI_CS

    ACT_PUL

    ACT_PUL

    ACT_PUL

    ACT_PUL

    ACT_PUL

    REACT_PUL

    REACT_PUL

    REACT_PUL

    REACT_PUL

    REACT_PUL

    V1+

    V1+

    V1-

    V1-

    V1

    U+LINE

    NEUTRAL

    NEUTRAL

    LINE_A

    LINE_A

    DVCC_PL

    DVCC_PL

    DVCC_EXT

    DVCC_FET1

    AFE_INT

    GND1

    RXD

    +12V

    -12V

    TXD

    MSP430AFE253

    ++V1

    CONNECT AGND and DGND

    www.ti.com Design Files

    6 Design Files

    6.1 SchematicsTo download the schematics, see TIDM-METROLOGY-HOST.

    Figure 21. TIDM-METROLOGY-HOST Schematic Page 1

    27TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • 10u

    DGND_APP

    10u

    0.1u

    DGND_APP

    10u

    0.1u

    DGND

    10u

    0.1u

    DGND_APP

    12pF

    12pF

    DGND_APP

    XT

    1

    10u

    0.1u

    AGND_APP

    AVCC_APP 10

    0

    47

    0n

    DGND_APP

    47pF

    47pF

    DGND_APP

    HCTC_XTL_4

    47k2.2n

    DGND_APP

    0

    0.1u

    0.1u0.1u

    0.1u

    DNP

    ISO7421FE

    ISO7421FE

    ISO7420FE

    135791113

    246

    1214

    810

    JTAG2

    80

    79

    78

    77

    76

    757473727170696867666564636261

    25242322212019181716151413121110987654321

    50

    49

    48

    47

    46

    45

    44

    43

    42

    41

    40

    39

    38

    37

    36

    35

    34

    33

    32

    31

    30

    29

    28

    27

    26

    60595857565554535251

    81

    82

    83

    84

    85

    86

    87

    88

    89

    90

    91

    92

    93

    94

    95

    96

    97

    98

    99

    10

    0

    U1

    7F_7G_7E_DP7P$17A_7B_7C_7DP$26F_6G_6E_DP6P$36A_6B_6C_6DP$45F_5G_5E_COL5P$55A_5B_5C_5DP$64F_4G_4E_DP4P$74A_4B_4C_4DP$83F_3G_3E_COL3P$93A_3B_3C_3DP$102F_2G_2E_DP2P$112A_2B_2C_2DP$121F_1G_1E_DP1P$131A_1B_1C_1DP$14

    COM3 P$15COM2 P$16COM1 P$17COM0 P$18

    F5_PR_P4_P3 P$19F1_F2_F3_F4 P$20PL_P0_P1_P2 P$21

    AU_AR_AD_AL P$22BT_B1_B0_BB P$23

    ANT_A2_A1_A0 P$24ENV_TX_RX_8BC P$25

    DOL_ERR_MINUS_MEM P$26

    C51

    C5

    C6

    C7

    C8

    C20

    C21

    123

    JT

    G_

    PW

    R2

    C28C29

    XT

    1

    C32C35

    R3

    R4

    123P

    WR

    2

    VCC11

    INA2

    INB3

    GND14 GND2 5OUTB 6OUTA 7VCC2 8

    VCC11

    OUTA2

    INB3

    GND14 GND2 5OUTB 6

    INA 7VCC2 8

    C4

    6

    C47

    C4821

    Q1

    G$

    1

    43

    Q1

    G$

    2

    R14C24

    R1

    5

    1 2

    DGND2

    VCC11

    OUTA2

    INB3

    GND14 GND2 5OUTB 6

    INA 7VCC2 8

    1 2

    DVCC21 23 45 67 8

    COMMS_APP

    C2

    C50C52

    C55

    TMS

    TM

    S

    TDI

    TD

    I

    TDO

    TD

    O

    RST/NMI

    RS

    T/N

    MI

    RST/NMI

    TCK

    TC

    K

    PU

    .0/D

    PP

    UR

    PU

    .1/D

    MV

    BU

    SV

    US

    BV

    18

    S4

    S4

    S5

    S5

    S6

    S6

    S7

    S7

    S10

    S10

    S11S11S12S12S13S13

    S14

    S14

    S15

    S15

    S16

    S16

    S17

    S17

    S18

    S18

    S19

    S19

    S20

    S20

    S21

    S21

    COM0

    CO

    M0

    COM1

    CO

    M1

    COM2

    CO

    M2

    COM3

    CO

    M3

    S8

    S8

    S9

    S9

    S1

    S1S0

    S0

    S2

    S2

    S3

    S3

    DGND_APP

    DG

    ND

    _A

    PP

    DG

    ND

    _A

    PP

    DG

    ND

    _A

    PP

    DG

    ND

    _A

    PP

    DG

    ND

    _A

    PP

    DGND_APP

    DGND_APP

    DGND_APPDGND_APP

    DGND_APP

    DVCC_APP

    DVCC_APPD

    VC

    C_

    AP

    P

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    DVCC_APP

    XOUT

    XOUT

    XIN

    XIN

    AVCC_APP

    AVCC_APP

    AGND_APP

    AGND_APP

    AGND_APP

    AG

    ND

    _A

    PP

    DVCC_APP_PL

    DVCC_APP_EXT

    DV

    CC

    _A

    PP

    _E

    XT

    LC

    DC

    AP

    LCDCAP

    HFOUT

    HF

    OU

    T

    HFIN

    HF

    IN

    DVCC_AFE

    DVCC_AFE

    DVCC_AFE

    DGND_AFE

    DGND_AFE

    DGND_AFE

    MSPI_CS

    MS

    PI_

    CS

    MSPI_CS

    MSPI_CLK

    MSPI_CLK

    MSPI_CLK

    SPI_CSSPI_CLK

    SOMISIMOM_SIMO

    M_SIMO

    M_SIMO

    M_SOMI

    M_SOMI

    M_SOMI

    A0SOMIA0SIMO

    A0CLK

    VR

    EG

    _E

    NR

    ES

    ET

    CC

    CC

    AS

    FD

    SFD

    RF

    _G

    PIO

    1

    RF_GPIO1

    RF

    _G

    PIO

    2

    RF_GPIO2

    A0CS

    DV

    CC

    _F

    ET

    2

    TE

    ST

    TEST

    APP_INT

    AP

    P_

    INT

    APP_INT

    AFE_INT

    Softbaugh SBLCDA4 interface

    Design Files www.ti.com

    Figure 22. TIDM-METROLOGY-HOST Schematic Page 2

    28 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • DVCC_APP

    DGND_APPDGND_APP

    10

    u

    0.1

    u

    S2

    0K

    27

    5

    15

    0u

    F

    0.1u

    SMAJ5.0ABCT

    4.7u/400V

    DGND_APPDGND_APP DGND_APPDGND_APP

    1.4k

    10p 10p

    27

    27

    33

    k

    4.7u

    DGND_APP

    LL103A

    TP

    D4

    E0

    04

    0.1u

    1M

    1 23 45 67 89 10

    11 1213 1415 1617 1819 20

    RF3RF3

    1 23 45 67 89 10

    11 1213 1415 1617 1819 20

    RF4RF4

    R77R78R79R80R81R82R83R84

    R86

    R87

    C4

    4

    C4

    5

    R105R106

    R108

    R85

    R107

    LL

    NN

    NCNC

    2626

    2222

    VO+VO+

    VO-VO-

    R5

    C3

    6

    C3

    7

    ZD

    3

    C38

    VBUS1

    GND4

    D-2

    D+3

    SHIELD5

    SHIELD16

    USB2

    R6

    C39 C40

    R7

    R35

    R9

    C42

    D2IO

    11

    IO2

    2

    GN

    D3

    VC

    C6

    IO4

    5

    IO3

    4

    IC7

    C43

    R2

    5

    RESETCC

    RESETCC

    A0CSA0CLKA0SIMO

    A0SIMOA0SIMO

    A0SOMI

    A0SOMIA0SOMI

    DGND_APP

    DGND_APP

    N_APP

    L_APP

    DVCC_APP_PL

    VREG_EN

    CCASFD

    RF_GPIO1RF_GPIO2

    PU.0/DPPUR

    PU.1/DM

    VBUS

    D-

    D+

    +

    www.ti.com Design Files

    Figure 23. TIDM-METROLOGY-HOST Schematic Page 3

    29TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Design Files www.ti.com

    6.2 Bill of MaterialsTo download the bill of materials (BOM), see the design files at TIDM-METROLOGY-HOST.

    Table 5. BOM

    ITEM QTY REFERENCE VALUE PART DESCRIPTION DIGIKEY PARTNUMBER1 1 S4 Switch Pushbutton Switch P8006S-ND2 1 C38 4.7 u/400 V Capacitor 565-1411-ND3 1 RS-232 9-pin connector DB-9 Connector A32115-ND

    609-3296-ND4 7 ACT, DGND2, DVCC2, REACT,HDR1, HDR2, JMP1 2-pin Jumper header Jumper header Break and use609-3296-ND5 4 JTG_PWR1, JTG_PWR2, PWR1, PWR2 3-pin Jumper header Jumper header Break and use609-3296-ND6 2 DGND1, DVCC1 4-pin Jumper header Jumper header Break and use609-3296-ND7 2 COMMS, COMMS_APP 42 8-pin header Jumper header Break and use

    8 1 LED1 Light Emitting Diode LED 511-1256-1-ND9 1 LED2 Light Emitting Diode LED 511-1254-1-ND10 2 JTAG1, JTAG2 14-pin Connector JTAG Connector MHB14K-ND11 2 RF3, RF4 20-pin Connector RF Connector TFM-110-02-SM-D-A-K12 1 USB2 USB Connector USB_RECEPTACLE WM17113-ND13 1 ZD1 3.6 V Zener Diode DNP

    R4. R15. R24, R26, R34, R77, R78, R79, R80, R81, R82, R83, R84, R85,14 20 0 Resistor 0603 P0.0GCT-NDR86, R87, R105, R106, R107, R108C1, C2, C6, C8, C10, C12, C21, C25, C26, C35, C37, C43, C45, C50,15 16 0.1 u Capacitor 0603 311-1366-1-NDC52, C55

    16 2 C53, C54 0.1 u Capacitor 0805 445-1349-1-ND17 1 R53 1.5 K Resistor 0603 P1.5KGCT-ND18 1 R31 1.5 K Resistor 0805 RMCF0805JT1K50CT-ND19 9 R17, R18, R20, R21, R47, R72, R73, R75, R76 1 K Resistor 0603 P1.0KGCT-ND20 2 R29, R36 1 K Resistor 0805 P1.0KACT-ND21 1 R25 1 M Resistor 0603 P1.0MGCT-ND22 8 D22, D23, D24, D25, D26, D27, D28, D29 1N4148 Diode 568-1749-1-ND23 1 R6 1.4 k Resistor 0603 P1.40KHCT-ND24 2 L5, L6 EXC-ML20A390U Inductor P10191CT-ND25 2 C24, C27 2.2 n Capacitor 0603 478-6210-1-ND26 2 R39, R40 2.2 k Resistor 0805 P2.2KGCT-ND27 1 ZD2 5.1 V Zener Diode 568-4874-1-ND

    30 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • www.ti.com Design Files

    Table 5. BOM (continued)ITEM QTY REFERENCE VALUE PART DESCRIPTION DIGIKEY PARTNUMBER28 1 C42 4.7 u Capacitor 0603 490-3302-1-ND29 2 R16, R19 6.8 Resistor 0603 P6.8GCT-ND30 2 R2, R3 10 Resistor 0603 P10GCT-ND31 2 C39, C40 10 p Capacitor 0603 490-1403-1-ND32 11 C5, C7, C9, C11, C15, C20, C22, C32, C44, C51, C23 10 u Polarized Capacitor 399-3685-1-ND33 4 C16, C19, C28, C29 12 pF Capacitor 0603 445-1270-1-ND34 3 C30, C34, C41 15 nF Capacitor 0603 445-5102-1-ND35 2 R7, R35 27 Resistor 0603 P27GCT-ND36 1 R9 33 k Resistor 0603 P33KGCT-ND37 2 R61, R14 47 K Resistor 0603 P47KGCT-ND38 8 C13, C14, C17, C18, C31, C33, C47, C48 47 pF Capacitor 0603 445-1277-1-ND39 1 R50 100 Resistor 0603 P100GCT-ND40 1 C36 150 F Polarized Capacitor P12917-ND41 3 R38, R41, R44 330 K Resistor 0603 P330KHCT-ND42 1 C49 470 n / 300 V~ Polarized Capacitor P12275-ND43 1 R22 470 / 5 W Resistor 45J470E-ND44 1 C4 2200 F Polarized Capacitor P5128-ND45 4 L15, L16, L17, L18 BLM21BD121SN1D Inductor 490-1044-1-ND46 1 U$2 CUI_XR Power supply module 102-1801-ND47 1 U1 F66XX---PZ100 MSP430F6638 100-pin TI chip48 1 Q1 HCTC_XTL_4 HF Crystal 887-1002-ND49 1 ISO1 ISO7420 8-pin DW Isolator chip 296-28742-1-ND50 2 ISO2, ISO3 ISO7421 8-pin DW Isolator chip 296-28426-ND51 6 D1, D2, D3, D4, D7, D10 LL103A Diode LLSD103ADICT-ND52 1 U$1 MSP430AFE_24TSSOP MSP430AFE 24-pin TSSOP TI chip53 2 U2, U5 PS8802 8-pin TSSOP PS8802-1-F3-AXCT-ND54 2 R1, R5 S20K275 Varistor 495-1417-ND55 1 LCD1 SBLCDA4 LCD Display ACD Will provide56 1 ZD3 SMAJ5.0ABCT Diode SMAJ5.0ABCT-ND57 2 D32, D33 SMAJ5.0CA Diode SMAJ5.0CABCT-ND58 2 OK1, OK2 PS2501-1-A 4-pin Isolator chip PS2501-1A-ND59 1 IC7 TPD4E004 6-pin Chip 296-23618-1-ND60 1 IC3 TPS77033 6-pin Chip 296-11051-1-ND61 1 XT1 XT1 LF Crystal 300-8341-1-ND

    31TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Design Files www.ti.com

    Table 5. BOM (continued)ITEM QTY REFERENCE VALUE PART DESCRIPTION DIGIKEY PARTNUMBER62 1 XT2 XT2 HF Crystal 887-1233-ND63 1 R23 DNP Resistor 0805 DNP64 1 R37 68 Resistor 0805 P68ACT-ND65 1 R27 DNP Resistor 0805 DNP66 1 R30 10 k Resistor 0805 P10KACT-ND67 1 R32 220 Resistor 0805 P220ACT-ND68 1 C46 470 n Capacitor 0603 445-3456-1-ND69 1 R33 DNP Resistor 0603 DNP70 1 R28 DNP Resistor 0603 DNP71 2 T1, T2 BC860B/BC857B BC857ASMD BC857B-TPMSCT-ND

    32 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • www.ti.com Design Files

    6.3 PCB Layer PlotsTo download the layer plots, see the design files at TIDM-METROLOGY-HOST.

    Figure 24. Top Layer Plot Figure 25. Bottom Layer Plot

    33TIDU455August 2014 Single-Phase Electric Meter with Isolated Energy MeasurementSubmit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • Design Files www.ti.com

    6.4 CAD Project FilesTo download the CAD project files, see the design files at TIDM-METROLOGY-HOST.

    6.5 Gerber FilesTo download the Gerber files, see the design files at TIDM-METROLOGY-HOST.

    6.6 Software FilesTo download the software files, see the design files at TIDM-METROLOGY-HOST.

    7 References

    1. Energy Measurement Results for CTs and Shunts on a TI Designed Meter Using MSP430AFE2xxDevices (SLAA536)

    8 About the AuthorMEKRE MESGANAW is a system applications engineer in the Smart Grid and Energy group at TexasInstruments, where he primarily works on electricity metering customer support and reference designdevelopment. Mekre received his bachelor of science and master of science in computer engineering fromthe Georgia Institute of Technology.

    34 Single-Phase Electric Meter with Isolated Energy Measurement TIDU455August 2014Submit Documentation Feedback

    Copyright 2014, Texas Instruments Incorporated

  • IMPORTANT NOTICE FOR TI REFERENCE DESIGNS

    Texas Instruments Incorporated ("TI") reference designs are solely intended to assist designers (Buyers) who are developing systems thatincorporate TI semiconductor products (also referred to herein as components). Buyer understands and agrees that Buyer remainsresponsible for using its independent analysis, evaluation and judgment in designing Buyers systems and products.TI reference designs have been created using standard laboratory conditions and engineering practices. TI has not conducted anytesting other than that specifically described in the published documentation for a particular reference design. TI may makecorrections, enhancements, improvements and other changes to its reference designs.Buyers are authorized to use TI reference designs with the TI component(s) identified in each particular reference design and to modify thereference design in the development of their end products. HOWEVER, NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPELOR OTHERWISE TO ANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY THIRD PARTY TECHNOLOGYOR INTELLECTUAL PROPERTY RIGHT, IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right,or other intellectual property right relating to any combination, machine, or process in which TI components or services are used.Information published by TI regarding third-party products or services does not constitute a license to use such products or services, or awarranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectualproperty of the third party, or a license from TI under the patents or other intellectual property of TI.TI REFERENCE DESIGNS ARE PROVIDED "AS IS". TI MAKES NO WARRANTIES OR REPRESENTATIONS WITH REGARD TO THEREFERENCE DESIGNS OR USE OF THE REFERENCE DESIGNS, EXPRESS, IMPLIED OR STATUTORY, INCLUDING ACCURACY ORCOMPLETENESS. TI DISCLAIMS ANY WARRANTY OF TITLE AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE, QUIET ENJOYMENT, QUIET POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTYINTELLECTUAL PROPERTY RIGHTS WITH REGARD TO TI REFERENCE DESIGNS OR USE THEREOF. TI SHALL NOT BE LIABLEFOR AND SHALL NOT DEFEND OR INDEMNIFY BUYERS AGAINST ANY THIRD PARTY INFRINGEMENT CLAIM THAT RELATES TOOR IS BASED ON A COMBINATION OF COMPONENTS PROVIDED IN A TI REFERENCE DESIGN. IN NO EVENT SHALL TI BELIABLE FOR ANY ACTUAL, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANYTHEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, ARISING INANY WAY OUT OF TI REFERENCE DESIGNS OR BUYERS USE OF TI REFERENCE DESIGNS.TI reserves the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services perJESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevantinformation before placing orders and should verify that such information is current and complete. All semiconductor products are soldsubject to TIs terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TIs termsand conditions of sale of semiconductor products. Testing and other quality control techniques for TI components are used to the extent TIdeems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is notnecessarily performed.TI assumes no liability for applications assistance or the design of Buyers products. Buyers are responsible for their products andapplications using TI components. To minimize the risks associated with Buyers products and applications, Buyers should provideadequate design and operating safeguards.Reproduction of significant portions of TI information in TI data books, data sheets or reference designs is permissible only if reproduction iswithout alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable forsuch altered documentation. Information of third parties may be subject to additional restrictions.Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirementsconcerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or supportthat may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards thatanticipate dangerous failures, monitor failures and their consequences, lessen the likelihood of dangerous failures and take appropriateremedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components inBuyers safety-critical applications.In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TIs goal is tohelp enable customers to design and create their own end-product solutions that meet applicable functional safety standards andrequirements. Nonetheless, such components are subject to these terms.No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the partieshave executed an agreement specifically governing such use.Only those TI components that TI has specifically designated as military grade or enhanced plastic are designed and intended for use inmilitary/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components thathave not been so designated is solely at Buyer's risk, and Buyer is solely responsible for compliance with all legal and regulatoryrequirements in connection with such use.TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use ofnon-designated products, TI will not be responsible for any failure to meet ISO/TS16949.IMPORTANT NOTICE

    Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265Copyright 2014, Texas Instruments Incorporated

    Single-Phase Electric Meter with Isolated Energy Measurement1System Description2Design Features2.1Hardware Implementation2.1.1Power Supply2.1.1.1Resistor Capacitor (RC) Power Supply2.1.1.2Switching-Based Power Supply

    2.1.2Analog Inputs2.1.2.1Voltage Inputs2.1.2.2Current Inputs

    2.2Software Implementation2.2.1Peripherals Setup2.2.1.1AFE SD24_A Setup2.2.1.2AFE Main Clock Setup2.2.1.3AFE UART/SPI Setup2.2.1.4F6638 Main Clock Setup2.2.1.5F6638 Real-Time Clock (RTC_B)2.2.1.6F6638 LCD Controller (LCD_B)

    2.2.2Metrology Foreground Process2.2.2.1Formulae

    2.2.3Metrology Background Process2.2.3.1Voltage and Current Signals2.2.3.2Phase Compensation2.2.3.3Frequency Measurement and Cycle Tracking2.2.3.4LED Pulse Generation

    2.2.4Application Processor Software2.2.5Transferring New E-Meter Parameters from AFE to MSP430F663x

    3Block Diagram4Energy Meter Demo4.1Connections to the Test Setup or AC Voltages4.2Jumper Settings4.3Power Supply Options

    5Results and Calibration5.1Viewing Results via LCD5.2Viewing Results via GUI

    6Design Files6.1Schematics6.2Bill of Materials6.3PCB Layer Plots6.4CAD Project Files6.5Gerber Files6.6Software Files

    7References8About the Author

    Important Notice