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

ADS131M04 Current-Detection Procedure

Figure 2-7 shows the details of the procedure followed by the ADS131M04 device to enter current-detection mode as well as the procedure followed when in this mode.

GUID-52D58C3E-7E99-4F75-B41B-87CF7C43A0ED-low.gifFigure 2-7 ADS131M04 Current-Detection Mode Process

This process begins by the MCU sending a standby command to the ADS131M04 device from its normal continuous conversion mode. By sending this command, the ADS131M04 device is put in standby mode. Note that the DRDY pin should not be asserted every time a new sample is available, like it was when the device was in normal conversion mode. The DRDY pin is only asserted low when in current-detection mode if tamper current is detected. In addition, the DRDY pin is not asserted low in standby mode since the device is not converting samples.

After the device is in standby mode, provide a pulse on the SYNC/ RESET pin, which enables the device to enter current-detection mode, assuming the CD_EN bit is already enabled in the corresponding ADS131M04 register. When in current-detection mode, the ADS131M04 checks to see if the absolute value of each sample is above the user-defined threshold, which is set by the CD_THRSHLD registers. If a sample is beyond the set threshold, a threshold counter for this current sampling window is incremented. After this threshold is incremented, a check is done to see if the threshold counter is above the value set by the CD_NUM bits in the corresponding ADS131M04 register. The CD_NUM bits configure the number of samples which need to exceed the threshold (CD_THRSHLD) for detection to occur. The purpose of requiring multiple samples for detection is to allow for noisy values that may exceed the threshold, but do not represent a high enough power level to warrant action by the host. If the threshold counter is greater than the value set by the CD_NUM bits, DRDY is asserted if the CD_ALLCH bit in the ADS131M04 register is set to 0 or if the CD_ALLCH bit is set to 1 and current is detected on all enabled channels. After DRDY is asserted, the device goes back to standby mode even if a full sample window has not been checked yet. If the number of samples checked equals the sample window, which is set by the CD_LEN bits in one of the ADS131M04 registers, and the threshold counter is not above CD_NUM, the device goes back to standby mode without DRDY having been asserted.

Figure 2-8 shows two example scenarios of running current-detection mode. In Figure 2-8, more than CD_NUM number of samples are not beyond the current-detection threshold for the first time current-detection mode is triggered. As a result, the ADS131M04 device is in current-detection mode for the maximum time period. For the second time current-detection mode is triggered, more than CD_NUM number of samples are beyond the current-detection threshold, which may indicate tampering has occurred. Immediately after more than CD_NUM samples are beyond the current-detection threshold, the ADS131M04 alerts the MCU and then exits current-detection mode instead of continuing in current-detection mode until the CD_LEN number of samples has been obtained. As a result, the time spent in current-detection mode is smaller the second time the current-detection mode is triggered in this example compared to the first time current-detection mode was triggered.

GUID-BBA4D00A-FE9F-4A72-BD15-AEF694C29120-low.gifFigure 2-8 ADS131M04 Current Detection Example