TIDUF25 june 2023 ADS131M08 , MSPM0G1507
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.
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:
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.
where
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: