Other Parts Discussed in Thread: MSPM0G3507,
Hi
I am reading data from ads124s08 adc using mspm0g3507 . but value i am getting is not as expected. i have checked with dso and all waveforms are correct as per data sheet. i am attaching waveform file and also code let me know where i am doing wrong.
int main(void)
{
    SYSCFG_DL_init();    // init all gpio and spi with spi mode 1
    delay_cycles(70400);  //wait for POST operation
    delay_cycles(32000);  //required min 20ns we provide 1ms delay
    delay_cycles(160000);        // delay of min of 4096*tclk
    readRegs( ID_ADDR_MASK,19,Data); //reading default setting
    ADS124S08_Init();   // configuring adc
    readRegs_after( ID_ADDR_MASK,19,Data); //readbck new configuration
    DL_GPIO_setPins(GPIO_LEDS_START_PORT,GPIO_LEDS_START_PIN);  // pull start pin high to start convertion
    delay_cycles(224000);
    while(1)
    {
        if (!DL_GPIO_readPins(GPIO_LEDS_DRDY_ADC_PORT, GPIO_LEDS_DRDY_ADC_PIN))  // check of low transition of DRDY pin
        {
                DL_SPI_transmitData8(SPI_0_INST,RDATA_OPCODE_MASK);
                delay_cycles(32000);
                iData.adcValue1 = dataRead(&dStatus, &dData, &dCRC);
         }
       RTDRes = CodeToRes(&iData);
       RTDTemp = calculateTemperature(RTDRes);
    }
}
data read 
uint32_t dataRead(uint32_t *dStatus, uint32_t *dData, uint32_t *dCRC)
{
    uint32_t xcrc;
    uint32_t xstatus;
    uint32_t iData;
    uint32_t Data_t;
    DL_GPIO_clearPins(GPIO_LEDS_CS0_PORT,GPIO_LEDS_CS0_PIN);
    if((registers_after[SYS_ADDR_MASK] & 0x01) == DATA_MODE_STATUS)
    {
        xstatus = xferWord(0x00);
        dStatus[0] = (uint8_t)xstatus;
    }
    // get the conversion data
    iData = xferWord(0x00);
    iData = (iData<<8) + xferWord(0x00);
    iData = (iData<<8) + xferWord(0x00);
    if((registers_after[SYS_ADDR_MASK] & 0x02) == DATA_MODE_CRC)
    {
        xcrc = xferWord(0x00);
        dCRC[0] = (uint8_t)xcrc;
    }
    DL_GPIO_setPins(GPIO_LEDS_CS0_PORT,GPIO_LEDS_CS0_PIN);
    Data_t = iData;
    return iData ;
}
transfer function:
uint32_t xferWord(uint32_t tx)
{
    uint32_t rx;
    /* Set up data for the next xmit */
    DL_SPI_transmitData32(SPI_0_INST,tx);
    /* Wait for data to appear */
   while(DL_SPI_isBusy(SPI_0_INST));
    rx= DL_SPI_receiveDataBlocking32(SPI_0_INST);
  //  rx= DL_SPI_receiveDataBlocking32(SPI_0_INST);
 //   rx= DL_SPI_receiveData32(SPI_0_INST);
    return rx;
}
Waveform:


 
				 
		 
					 
                           
				