TIDUF25 june 2023 ADS131M08 , MSPM0G1507
The foreground process includes the initial setup of the MSPM0+ MCU hardware and software and the ADS131M08 registers immediately after a device RESET. Figure 3-2 shows the flowchart for this process.
The initialization routines involve the setup of the MSPM0G3507:
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 THVD1400 device must have the 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 MSPM0+ 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 MSPM0+ MCU but before the GUI sends out the 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 3.8.1.
For the 3-phase configuration, there are three voltage-current mappings, where each voltage-to-current mapping has a different voltage and current channel. Specifically, 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 and the same for Line C. For simplicity, note that each voltage-to-current mapping 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 4.2.4.1 for more information about the different items displayed on the LCD.