TIDUEM8B March   2019  – February 2021

 

  1.   1
  2.   2
  3.   3
  4.   4
  5.   5
  6.   6
    1.     7
      1.      8
      2.      9
    2.     10
  7.   11
    1.     12
    2.     13
      1.      14
      2.      15
      3.      16
      4.      17
      5.      18
      6.      19
      7.      20
      8.      21
      9.      22
      10.      23
    3.     24
      1.      25
        1.       26
        2.       27
        3.       28
        4.       29
          1.        30
          2.        31
      2.      32
        1.       33
          1.        34
          2.        35
          3.        36
          4.        37
          5.        38
          6.        39
          7.        40
        2.       41
          1.        42
        3.       43
          1.        44
            1.         45
            2.         46
          2.        47
          3.        48
  8.   49
    1.     50
      1.      51
      2.      52
        1.       53
          1.        54
          2.        55
        2.       56
      3.      57
    2.     58
      1.      59
        1.       60
        2.       61
        3.       62
          1.        63
          2.        64
            1.         65
            2.         66
              1.          67
                1.           68
                2.           69
              2.          70
              3.          71
      2.      72
        1.       73
        2.       74
  9.   75
    1.     76
    2.     77
    3.     78
      1.      79
    4.     80
    5.     81
    6.     82
  10.   83
    1.     84
  11.   85
  12.   86

Foreground Process

The foreground process includes the initial setup of the MSP432 hardware and software and the ADS131M04 registers immediately after a device RESET. Figure 2-9 shows the flowchart for this process.

GUID-46BDC2E5-D0F0-4DB1-8F4A-847BE13FC893-low.gifFigure 2-9 Foreground Process

The initialization routines involve the setup of the MSP432 general purpose input/output (GPIO) port pins and associated port map controller; MSP432 clock system; MSP432 USCI_A0 for UART functionality; MSP432 RTC module for clock functionality; MSP432 LCD; MSP432 DMA; ADS131M04 registers; and MSP432 metrology variables.

After the hardware is setup, any received frames from the GUI are processed. If RS-485 is selected for communication to the PC GUI, the THVD1500 device must have its RE and DE pins driven to enable the receiver and driver during the proper points in time to receive packets from the PC GUI and send responses back to the GUI. After any packet is sent from the MSP432 MCU to the PC GUI, the foreground process is responsible for asserting the RE and DE pins after the packet has been completely sent out from the MSP432 MCU but before the GUI sends out its next packet.

Subsequently, the foreground process checks whether the background process has notified the foreground process to calculate new metering parameters for any voltage-current mappings. This notification is accomplished through the assertion of the "PHASE_STATUS_NEW_LOG" status flag whenever a frame of data is available for processing. The data frame consists of the processed dot products that were accumulated for approximately one second in the background process. This is equivalent to an accumulation of 50 or 60 cycles of data synchronized to the incoming voltage signal. In addition, a sample counter keeps track of how many samples accumulate over this frame period. This count can vary as the software synchronizes with the incoming mains frequency.

The processed dot products include the VRMS, IRMS, active power, and reactive power. These dot products are used by the foreground process to calculate the corresponding metrology readings in real-world units. Processed voltage dot products, current dot products, active energy dot products, and reactive energy dot products are accumulated in separate 64-bit registers to further process and obtain the RMS and mean values. Using the calculated values of active and reactive power of the foreground process, the apparent power is calculated. The frequency (in Hz) and power factor are also calculated using parameters calculated by the background process using the formulas in Section 2.3.2.2.1.

For the two-voltage configuration, there are two voltage-current mappings, where each voltage-to-current mapping has a different voltage and current channel. Specifically, in the two-voltage mapping, the line-to-neutral voltage measurement for line A and the line A current measurement are associated with each other for one mapping and the line-to-neutral voltage measurement for line B and the line B current measurement are associated with each other for the other mapping. Otherwise, for the one-voltage configuration, each voltage-current mapping has the same voltage for each mapping since only one voltage is measured. In the one-voltage configuration, the line-to-line voltage measurement is associated with the line A current for the first mapping and the same line-to-line voltage measurement is associated with the line B current for the second mapping. For simplicity, note that each voltage-to-current mapping, whether for two-voltage or one-voltage configurations, is referred to as a phase in the rest of this documentation as well as in the PC GUI.

The foreground process also updates the LCD. The LCD display item is changed every two seconds. See Section 3.2.1.3.1 for more information about the different items displayed on the LCD.

In addition, the foreground process also takes action if the FLT pin of the TPS25921L device has been asserted low, which would indicate an undervoltage, overvoltage, or thermal shutdown event has occurred. If the FLT pin has been asserted low and it is the first time this has happened since the MSP432 MCU has been reset, the MSP432 MCU provides a pulse on the EN/UVLO pin of the TPS25921L device to reset the device. This reset pulse is meant to reconnect the load at the TPS25921L OUT pin with the source at its IN pin since this would be disconnected if the fault source was from a thermal shutdown event. After resetting the TPS25921L, if another thermal shutdown event occurs, the TPS25921L output is disconnected from the input again and the MSP432 MCU does not make any further attempts to provide a reset pulse to the TPS25921L to reconnect the output to the input rail.