TIDUF25 june   2023 ADS131M08 , MSPM0G1507

 

  1.   1
  2.   Description
  3.   Resources
  4.   Features
  5.   Applications
  6.   6
  7. 1System Description
    1. 1.1 End Equipment
    2. 1.2 Electricity Meter
    3. 1.3 Power Quality Meter, Power Quality Analyzer
    4. 1.4 Key System Specifications
  8. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Design Considerations
      1. 2.2.1 External Supply Voltage Supervisor (SVS) With TPS3840
      2. 2.2.2 Magnetic Tamper Detection With TMAG5273 Linear 3D Hall-Effect Sensor
      3. 2.2.3 Analog Inputs
        1. 2.2.3.1 Voltage Measurement Analog Front End
        2. 2.2.3.2 Current Measurement Analog Front End
    3. 2.3 Highlighted Products
      1. 2.3.1  ADS131M08
      2. 2.3.2  MSPM0G3507
      3. 2.3.3  MSP430FR4131 for Driving Segmented LCD Displays
      4. 2.3.4  TPS3840
      5. 2.3.5  THVD1400
      6. 2.3.6  ISO6731
      7. 2.3.7  ISO6720
      8. 2.3.8  TRS3232E
      9. 2.3.9  TPS709
      10. 2.3.10 TMAG5273
  9. 3System Design Theory
    1. 3.1  How to Implement Software for Metrology Testing
    2. 3.2  Clocking System
    3. 3.3  UART Setup for GUI Communication
    4. 3.4  Real-Time Clock (RTC)
    5. 3.5  LCD Controller in MSP430FR4131
    6. 3.6  Direct Memory Access (DMA)
    7. 3.7  ADC Setup
    8. 3.8  Foreground Process
      1. 3.8.1 Formulas
    9. 3.9  Background Process
    10. 3.10 Software Function per_sample_dsp()
      1. 3.10.1 Voltage and Current Signals
      2. 3.10.2 Frequency Measurement and Cycle Tracking
    11. 3.11 LED Pulse Generation
    12. 3.12 Phase Compensation
  10. 4Hardware, Software, Testing Requirements, and Test Results
    1. 4.1 Required Hardware and Software
      1. 4.1.1 Hardware
      2. 4.1.2 Cautions and Warnings
    2. 4.2 Test Setup
      1. 4.2.1  Connecting the TIDA-010243 to the Metering Test Equipment
      2. 4.2.2  Power Supply Options and Jumper Settings
      3. 4.2.3  Electricity Meter Metrology Accuracy Testing
      4. 4.2.4  Viewing Metrology Readings and Calibration
        1. 4.2.4.1 Viewing Results From LCD
        2. 4.2.4.2 Calibrating and Viewing Results From PC
      5. 4.2.5  Calibration and FLASH Settings for MSPM0+ MCU
      6. 4.2.6  Gain Calibration
      7. 4.2.7  Voltage and Current Gain Calibration
      8. 4.2.8  Active Power Gain Calibration
      9. 4.2.9  Offset Calibration
      10. 4.2.10 Phase Calibration
      11. 4.2.11 Software Code Example
    3. 4.3 Test Results
      1. 4.3.1 SVS Functionality Testing
      2. 4.3.2 Electricity Meter Metrology Accuracy Results
  11. 5Design and Documentation Support
    1. 5.1 Design Files
      1. 5.1.1 Schematics
      2. 5.1.2 BOM
      3. 5.1.3 PCB Layout Recommendations
      4. 5.1.4 Layout Prints
      5. 5.1.5 Gerber Files
    2. 5.2 Tools and Software
    3. 5.3 Documentation Support
    4. 5.4 Support Resources
    5. 5.5 Trademarks
  12. 6About the Author

ADC Setup

The ADS131M08 registers must be initialized to deliver measurement data from all 7 channels (the 8-th channel is unused but still has to be read out over SPI). This process is followed when the ADS131M08 is being first setup after the MSPM0G3507 MCU resets as well as each time calibration is performed.

GUID-20230518-SS0I-DFHS-LCVW-WFX5MP93XNB0-low.svgFigure 3-1 ADC Initialization and Synchronization Process

The SPI module of the MSPM0+ MCU is configured for communication to the ADS131M08 device as a controller device that uses 4-wire mode (the chip-select signal is automatically asserted high and low by the SPI hardware module) and has a 19.87-MHz SPI clock that is derived from the MCU MCLK clock, divided by 4. After the SPI is setup, all interrupts are disabled and a reset command is sent from the MSPM0+ MCU to the ADS131M08 via SPI. Interrupts are then re-enabled and the MSPM0+ MCU sends commands to the ADS131M08 to configure the registers.

By sending write commands to the ADS131M08 registers, the following configuration is done:

  • MODE register settings: 16-bit CCITT CRC used, 24-bit length for each word in the ADS131M08 packet, DRDY signal asserted on most lagging enabled channel, DRDY asserted high when conversion value is not available, DRDY asserted low when conversion values are ready
  • GAIN1 register settings: PGA gain of 1 used for all four ADC channels
  • CFG register settings: Current detection mode disabled
  • CHx_CNG register settings (where x is the channel number)
    • 3-phase mode: All seven ADC channel inputs connected to external ADC pins and channel phase delay set to 0 for each channel (note that software phase compensation is used instead of ADS131M08 hardware phase compensation).
  • CLOCK register settings: 512 OSR, all channels enabled, and high-resolution modulator power mode

After the ADS131M08 registers are properly initialized, the MSPM0+ MCU is configured to generate a port interrupt whenever a falling edge occurs on the DRDY pin, which indicates that the ADS131M08 has new measurement samples available.

The ADS131M08 modulator clock is derived from the clock fed to the CLKIN pin, which is output from the CLK_OUT output of the MSPM0+ MCU. The clock fed to the CLKIN pin of the ADS131M08 device is internally divided by two, to generate the ADS131M08 modulator clock. The sampling frequency of the ADS131M08 is therefore defined as shown in Equation 3.

Equation 3. fS=fMOSR=fCLKIN2×OSR

where

  • ƒS is the sampling rate
  • ƒM is the modulator clock frequency
  • ƒCLKIN is the clock fed to the ADS131M08 CLKIN pin
  • OSR is the selected oversampling ratio

In this design, the CLK_OUT signal of the MSPM0+ MCU that is fed to the ADS131M08 CLKIN pin has a frequency of 8.192 MHz. The oversampling ratio is selected to be 512 with the appropriate register setting. As a result, the ADS131M08 modulator clock is set to 4.096 MHz and the sample rate is set to 8000 samples per second.

For a 3-phase system where each line-to-neutral voltage is measured, at least six ADC channels are necessary to independently measure three voltages and three currents. In this design, the following ADS131M08 channel mappings are used in software for the 3-phase configuration:

  • AIN0P and AIN0N ADS131M08 ADC channel pins → Voltage V1 (Phase A Line-to-Neutral Voltage)
  • AIN1P and AIN1N ADS131M08 ADC channel pins → Voltage V2 (Phase B Line-to-Neutral Voltage)
  • AIN2P and AIN2N ADS131M08 ADC channel pins → Voltage V3 (Phase C Line-to-Neutral Voltage)
  • AIN3P and AIN3N ADS131M08 ADC channel pins → Current I1 (Phase A Current)
  • AIN4P and AIN4N ADS131M08 ADC channel pins → Current I2 (Phase B Current)
  • AIN5P and AIN5N ADS131M08 ADC channel pins → Current I3 (Phase C Current)
  • AIN6P and AIN6N ADS131M08 ADC channel pins → Current N (Neutral Current)
  • AIN7P and AIN7N ADS131M08 ADC channel pins → unconnected, channel 7 data is always reported as 0x00 00 00 over SPI when ADS131M08 is 24-bit mode with channel 7 disabled