TIDUEM8B March 2019 – February 2021
Figure 2-8 shows the process used to initialize the ADS131M04. This process is followed when the ADS131M04 is being first setup after the MSP432 MCU resets as well as each time calibration is performed.
Before setting up the ADS131M04 device, the modulator clock of the ADS131M04 is disabled to prevent the ADS131M04 from generating new samples while trying to set it up. The modulator clock is disabled by disabling the SMCLK output of the MSP432 MCU, which is fed to the CLKIN pin of the ADS131M04. Disabling the SMCLK output only needs to be done after calibration and not after an MSP432 MCU reset event since the SMCLK clock output is automatically not output after the MSP432 MCU resets.
After the SMCLK output is disabled, the EUSCIB0 SPI module of the MSP432 MCU is configured for communication to the ADS131M04 device. The EUSCIB0 SPI module is specifically configured as a master device that uses 3-wire mode (the chip select signal is manually asserted high and low in the test software instead of using the chip select feature of the SPI module) and has an 8.192-MHz SPI clock that is derived from the 8.192-MHz SMCLK clock. After the SPI is setup, all interrupts are disabled and a reset command is sent from the MSP432 MCU to the ADS131M04 via SPI. Interrupts are then re-enabled and the MSP432 MCU sends commands to the ADS131M04 to configure its registers.
At this point, note that the modulation clock is not output by the MSP432 MCU yet, which means that sampling is not started yet. By sending commands to the ADS131M04 to initialize the ADS131M04 registers, the ADS131M04 is configured for the following:
After the ADS131M04 registers are properly initialized, the MSP432 MCU is configured to generate a port interrupt whenever a falling edge occurs on the DRDY pin, which would indicate that the ADS131M04 has new current samples that are available. Next, the MSP432 MCU outputs the SMCLK clock to the ADS131M04, which starts the voltage and current sampling.
The ADS131M04 modulator clock is derived from the clock fed to its CLKIN pin, which is output from the SMCLK output of the MSP432 MCU. The clock fed to the CLKIN pin of the ADS131M04 device is internally divided by two, to generate the ADS131M04 modulator clock. The sampling frequency of the ADS131M04 is therefore defined as fs = fM / OSR = fCLKIN / (2 × OSR), where fs is the sampling rate, fM is the modulator clock frequency, fCLKIN is the clock fed to the ADS131M04 CLKIN pin, and OSR is the selected oversampling ratio. In this design, the SMCLK clock of the MSP432 MCU that is fed to the ADS131M04 CLKIN pin has a frequency of 8.192 MHz. The oversampling ratio is selected to be 512 . As a result, the ADS131M04 modulator clock is set to 4.096 MHz and the sample rate is set to 8000 samples per second.
For a two-voltage system where each line-to-neutral voltage is measured, at least four ADC channels are necessary to independently measure two voltages and two currents. In this design, the following ADS131M04 channel mappings are used in software for the two-voltage configuration:
For a balanced split-phase system, each line-to-neutral voltage should be half of the line-to-line voltage. In the one-voltage configuration of this design, only the line-to-line voltage is measured. The line-to-line voltage readings are divided by two (this division is done automatically by following the calibration process) to get the line-to-neutral voltages of each phase. As a result, the same ADC samples are used in the software to calculate the RMS voltage and power for the two phases. This configuration uses three ADC channels: one to measure the line-to-line voltage and the other two for the two currents. In this design, the following ADS131M04 channel mappings are used in software for the one-voltage configuration:
Since the line-to-line voltage measured in the one-voltage configuration is the Phase A line voltage - Phase B line voltage and not the Phase B line voltage - Phase A line voltage, the orientation for phase B current should be reversed, which is done by either swapping where the positive and negative output terminals of the current transformers of Phase B are connected, swapping the polarity of the current fed to the Phase B current input in the design, or by using the same input current and CT output terminal polarity at phase A and just negating the current channel ADC channels in software. To prevent having to do any hardware changes when switching from two-voltage to one-voltage modes, this design reverses the polarity of the current channels by choosing the option where the phase B current channel values are negated in the test software.