This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS8332: ADS8332: Invalid data by reading ADC results

Part Number: ADS8332

Hello,

I have two ADS8332 in daisy-chain configuration. Writing and Reading my CFR register works with following configuration:

CFR1 = 0b111011111101

CFR2 = 0b111011011101

Currently, I try to read out all 16 channels, whereby on channel 1 and 9 a sinus signal (70 Hz, sampling frequency 2000 Hz) is connected. SCLK works with 41.67 ns (corresponds to (12 MHz)). The plots in Matlab show that the sinus signal can not be reproduced.

Code:

void startADC(int16_t ADS833x_Result[number_channels][SIZE], int cycle){

    uint16_t LoopCount;    // Count times through idle loop
    uint16_t Channel_Number = 8;


    for(LoopCount=0;LoopCount<Channel_Number;LoopCount++)
    {

        int16_t tempBuffer[2];
        for (int i =0; i<2;i++){
            tempBuffer[i]=0;
        }

        TIMER_Enable(TIMER1,false);
        TIMER_CounterSet(TIMER1,0);
        TIMER_Enable(TIMER1,true);
        GPIO_PinOutClear(gpioPortB,1);
        // Timing of minimum 40 ns
        while(TIMER1->CNT<3){
            ;
        }
        TIMER_Enable(TIMER1,false);
        GPIO_PinOutSet(gpioPortB,1);

        while(GPIO_PinOutGet(gpioPortB,1) != 1){
            ;
        }
        ADS833x_ReadRegister(&tempBuffer[0],0xD000);


        ADS833x_Result[LoopCount][cycle] = tempBuffer[0];
        ADS833x_Result[LoopCount+8][cycle] = tempBuffer[1];
    }


}

void ADS833x_ReadRegister(int16_t dataBuffer[2], uint16_t command)    
{
    uint16_t ReadData_MSB = command >> 8;
    uint16_t ReadData_LSB = command & 0xFF;

    uint16_t adc1_MSB;
    uint16_t adc1_LSB;
    uint16_t adc2_MSB;
    uint16_t adc2_LSB;


    GPIO_PinOutClear(gpioPortB,6),GPIO_PinOutClear(gpioPortB,0);


    adc2_MSB = USART_SpiTransfer(USART2,ReadData_MSB);
    adc2_LSB = USART_SpiTransfer(USART2,ReadData_LSB);
    adc1_MSB = USART_SpiTransfer(USART2,0);
    adc1_LSB = USART_SpiTransfer(USART2,0);

    GPIO_PinOutSet(gpioPortB,6), GPIO_PinOutSet(gpioPortB,0);


    dataBuffer[0] = (((adc1_MSB<<8)|0x00FF)&((adc1_LSB)|0xFF00));
    dataBuffer[1] = (((adc2_MSB<<8)|0x00FF)&((adc2_LSB)|0xFF00));


}

I am surprised about the bad reconstruction of the signal in CH1 and CH9 (in spite of a sampling frequency of 2000 Hz) as well as about the curves at CH2 and CH10.

However, I have checked all code lines, the SPI (between ADC and MCU) and UART (between MCU and PC) connection repeatedly, the error must be found in converting. Also changing clock polarity and phase do not have an positive effect on the results. Further on attached is a timing diagramm:

(Reading all 16 channels --> one cycle)

(zooming in --> reading two channels)

Thank you and Kind Regards,

Sebastian

  • Hi Sebastian,

    The recommended SPI settings are CPOL=1, CPHA=0. If you are already writing the registers and able to read/confirm the register settings successfully, you do not need to change these settings.

    What is the common mode voltage of the sinusoidal input signal?
    Can you please share the complete schematic of the ADS8332 showing the supply connections, all associated bypass capacitors, input drive circuitry/RC filters and reference drive circuit? Is this design on a PCB board with a dedicated ground layer?

    Thanks and Best Regards,
    Luis

  • Hi Luis,

    the attached figures below answer your questions. Yes, the design is on an etched PCB board with a dedicated ground layer.

    Thank you and Kind Regards,

    Sebastian

  • Unfortunately, the problem has not yet been resolved. Iam thankful for every reference and advice.

    Thank you and Best Regards,

    Sebastian