TIDUEM7A April   2019  – February 2021

 

  1.   Description
  2.   Resources
  3.   Features
  4.   Applications
  5.   5
  6. 1System Description
    1. 1.1 End Equipment
      1. 1.1.1 Electricity Meter
    2. 1.2 Key System Specifications
  7. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Highlighted Products
      1. 2.2.1 ADS131M04
      2. 2.2.2 TPS7A78
      3. 2.2.3 MSP432P4111
      4. 2.2.4 TPS3840
      5. 2.2.5 THVD1500
      6. 2.2.6 ISO7731B
      7. 2.2.7 TRS3232E
      8. 2.2.8 TPS709
      9. 2.2.9 ISO7720
    3. 2.3 Design Considerations
      1. 2.3.1 Design Hardware Implementation
        1. 2.3.1.1 TPS7A78 Cap-Drop Supply
        2. 2.3.1.2 TPS3840 SVS
        3. 2.3.1.3 Analog Inputs
          1. 2.3.1.3.1 Voltage Measurement Analog Front End
          2. 2.3.1.3.2 Current Measurement Analog Front End
      2. 2.3.2 Current-Detection Mode
        1. 2.3.2.1 ADS131M04 Current-Detection Procedure
        2. 2.3.2.2 Using an MCU to Trigger Current-Detection Mode
          1. 2.3.2.2.1 Using a Timer to Trigger Current-Detection Mode Regularly
          2. 2.3.2.2.2 MCU Procedure for Entering and Exiting Current-Detection Mode
        3. 2.3.2.3 How to Implement Software for Metrology Testing
          1. 2.3.2.3.1 Setup
            1. 2.3.2.3.1.1 Clock
            2. 2.3.2.3.1.2 Port Map
            3. 2.3.2.3.1.3 UART Setup for GUI Communication
            4. 2.3.2.3.1.4 Real-Time Clock (RTC)
            5. 2.3.2.3.1.5 LCD Controller
            6. 2.3.2.3.1.6 Direct Memory Access (DMA)
            7. 2.3.2.3.1.7 ADC Setup
          2. 2.3.2.3.2 Foreground Process
            1. 2.3.2.3.2.1 Formulas
          3. 2.3.2.3.3 Background Process
            1. 2.3.2.3.3.1 per_sample_dsp()
              1. 2.3.2.3.3.1.1 Voltage and Current Signals
              2. 2.3.2.3.3.1.2 Frequency Measurement and Cycle Tracking
            2. 2.3.2.3.3.2 LED Pulse Generation
            3. 2.3.2.3.3.3 Phase Compensation
    4. 2.4 Hardware, Software, Testing Requirements, and Test Results
      1. 2.4.1 Required Hardware and Software
        1. 2.4.1.1 Cautions and Warnings
        2. 2.4.1.2 Hardware
          1. 2.4.1.2.1 Connections to the Test Setup
          2. 2.4.1.2.2 Power Supply Options and Jumper Settings
        3. 2.4.1.3 Software
      2. 2.4.2 Testing and Results
        1. 2.4.2.1 Test Setup
          1. 2.4.2.1.1 SVS and Cap-Drop Functionality Testing
          2. 2.4.2.1.2 Electricity Meter Metrology Accuracy Testing
          3. 2.4.2.1.3 Current-Detection Mode Testing
          4. 2.4.2.1.4 Viewing Metrology Readings and Calibration
            1. 2.4.2.1.4.1 Viewing Results From LCD
            2. 2.4.2.1.4.2 Calibrating and Viewing Results From PC
              1. 2.4.2.1.4.2.1 Viewing Results
              2. 2.4.2.1.4.2.2 Calibration
                1. 2.4.2.1.4.2.2.1 Gain Calibration
                  1. 4.2.1.4.2.2.1.1 Voltage and Current Gain Calibration
                  2. 4.2.1.4.2.2.1.2 Active Power Gain Calibration
                2. 2.4.2.1.4.2.2.2 Offset Calibration
                3. 2.4.2.1.4.2.2.3 Phase Calibration
        2. 2.4.2.2 Test Results
          1. 2.4.2.2.1 SVS and TPS7A78 Functionality Testing Results
          2. 2.4.2.2.2 Electricity Meter Metrology Accuracy Results
          3. 2.4.2.2.3 Current-Detection Mode Results
  8. 3Design Files
    1. 3.1 Schematics
    2. 3.2 Bill of Materials
    3. 3.3 PCB Layout Recommendations
      1. 3.3.1 Layout Prints
    4. 3.4 Altium Project
    5. 3.5 Gerber Files
    6. 3.6 Assembly Drawings
  9. 4Related Documentation
    1. 4.1 Trademarks
  10. 5About the Author
  11. 6Revision History
Using a Timer to Trigger Current-Detection Mode Regularly

To have the ADS131M04 device enter current-detection mode regularly without CPU intervention, one option is to connect the timer output of an MCU to the SYNC/ RST pin on the ADS131M04 device. The timer can be set to have its output provide the necessary pulse to cause the ADS131M04 device to enter current-detection mode from standby mode at regular intervals. In this design, the pin connected to the ADS131M04 SYNC/ RESET pin can be port mapped to a timer output from one of the timer A modules of the MSP432 MCU. This timer can be clocked from the low-frequency crystal on the board, which enables the timer to be functional if the MSP432 MCU were to enter a low-power mode where SMCLK and its CPU clock were disabled, thereby enabling the reduction of the system current consumption.

In this design, the timer for driving the SYNC/ Reset pin is configured to count in up-mode, where the timer counts to a value set in its TAxCCR0 register. After counting up to TAxCCR0, the timer is reset back to 0 at the next timer clock cycle. Figure 2-9 shows the timer output connected to the SYNC/ Reset pin is set for a “reset/set” output mode. In this mode, the SYNC/ Reset pin is asserted low when the timer first counts up to the value in the TAxCCR1 register and the pin is asserted high when the timer counts back to 0 again. To enter current-detection mode immediately, the timer count is initialized with a value equal to TAxCCR1 before the timer is first started.

GUID-8BE7946C-7D57-4BF0-B850-B42BC54143D1-low.gifFigure 2-9 Timer Output Configuration

The TAxCCR0 register and the frequency of the timer sets the frequency for entering into current-detection mode. The timer A module of the MSP432 MCU has clock dividers, which are used to divide the clock source for a slower frequency timer. Equation 4 shows the frequency of the timer based on the selected clock divider.

Equation 4. GUID-01103D4D-4332-43C4-BB25-16F23188151A-low.gif

The time between triggers to enter current-detection mode can be calculated with Equation 5:

Equation 5. GUID-328B1496-C50D-4172-A1C7-1DC35588B18D-low.gif

The duration of the time of when the SYNC/ RESET pin is held low, the negative pulse width time, is also calculated as Equation 6 shows:

Equation 6. GUID-BDD1E49E-5892-4E24-8EFC-BDF54B5665AA-low.gif

As an example, suppose that the frequency of the timer clock source is 32,768 Hz and the values of TAxCCR0 and TAXCCR1 registers are 65,535, which is the maximum value that these two 16-bit registers could hold. If current-detection mode is desired to occur once every 10 seconds, then the timer clock divider can be set to a value to 5, which results in a timer frequency of 6553.6 Hz and a negative pulse width time of 153 microseconds. As a different example, if current-detection mode is to occur once very 64 seconds, then the timer clock divider value can be set to 32, which results in a timer frequency of 1024 Hz and a negative pulse width time of 977 microseconds.