Post Go back to editing

How can I set the sampling rate for the AD7389-4 chipset?

Category: Hardware
Product Number: AD7389-4

Hello support team,

For the AD7389-4 chipset, how can I configure the sampling rate for all the 4 channels? What's the default output format of it? Can I change it?

Thank you very much for your help and support.

Looking forward to your response.

Best regards,

Lin Li

  • Hi  ,

    Thank you for reaching out. I wanted to acknowledge your queries.  will look into this and get back to you shortly.

    Thanks again for your patience.

    regards,

    Red

  • Hi Red,

    Thanks for your response.

    Regards,

    Lin

  • Hi Red,

    We are looking forward to the answers and solution to my posted questions.

    We are now trying to readback a 100 KHz sine wave signal from each channel. However, I can't get correct signal from my SPI code and FFT code.

    Thanks again for your help.

    Regards,

    Lin

  • looking forward to the advice and suggestion.

    Regards,

    Lin

  • Hi,  .

    Since you are using a 4-wire mode configuration, I am expecting a performance of a maximum throughput rate, 2 MSPS. Is this happening at any input frequency? Try lowering it down, around 1 kHz. Just to be sure, what is your CPOL and CPHA? This should be in mode 2. 

    Warm regards,
    Jo

  • Hi Jo,

    Actually we use 1-wire mode. For lower frequency signal, it's the same result, can't get the sine wave signal. Yes, I confirmed the SPI is in mode 2 (CPOL=1 and CPHA=0). All the register write and read are working fine. Only the continuous data conversion is not work.

    FYI, I only use one read (NOP) command for each sample read in the continuous reading. After after that I will delete the very first sample as it's not meaningful. Is that one read command a problem?

    Also, the EVAL + SDP + TCE setup is working well. We can get a FFT peak for 250 KHz input signal. 

    However, my own setup EVAL + TI's AM273x EVM + CCS is not working.

    I'm blocked by this issue for a week and cause the project delayed. So please help me with it. If you need me to share the source code or any other information, just let me know.

    Looking forward to your further advice and suggestion.

    Best regards,

    Lin

  • Hi Jo,

    As the EVAL + SDP + TCE setup is working, how can I get the SPI command sequence from TCE when I hit the FFT and continuous running?

    I want use that command sequence to modify my own code.

    Thanks,

    Lin

  • Hi,  .

    There’s quite a bit to unpack in this query. Let’s first revisit your main question to ensure we’re aligned.

    For the AD7389-4 chipset, how can I configure the sampling rate for all the 4 channels? What's the default output format of it? Can I change it?

    Since it is in 1-wire mode configuration, you should expect a throughput rate of 500 ksps. What do you mean by its output format? Are you pertaining to its coding scheme? If yes, it should be in two's complement.

    FYI, I only use one read (NOP) command for each sample read in the continuous reading. After after that I will delete the very first sample as it's not meaningful. Is that one read command a problem?

    Please refer to this timing diagram. Multiple NOPs were used. The output should be seen each time you toggle the CS to low.

    BTW. If we're now discussing topics like NOP commands and FFTs, I recommend creating a separate query. This helps other readers and customers more easily find relevant discussions

    Warm regards,
    Jo

  • Hi Jo,

    Thanks for your answers and explanation.

    If the throughput rate is 500 ksps for 1-wire, 100 KHz sine wave input should be okay. But I can't get the sine wave signal which means we still have some issue.

    Thanks for your confirmation of the two's complement output format. I also verified it with Saleae logic capture.

    For the NOP and 1-wire mode timing, my code is follows that information. Here I attached my source code, could you please check it out.

    void AD738x_dataConversion(void)
    {
        int16_t adcResults[NUM_CHANNELS];
        int32_t transferOK;
        uint8_t txBuf[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
        uint8_t rxBuf[8] = { 0 };
        MIBSPI_Transaction spiTransaction;
    
        spiTransaction.count            = 8;         // 4 channels x 16 bits = 8 bytes
        spiTransaction.txBuf            = (void *)txBuf;
        spiTransaction.rxBuf            = (void *)rxBuf;
        spiTransaction.peripheralIndex  = 0U;
        spiTransaction.arg              = NULL;
    
        DebugP_log("Starting AD738x data conversion loop...\n");
    
        for (int i = 0; i < NUM_SAMPLES; i++)
        {
            // data conversion, first read commands
            transferOK = MIBSPI_transfer(gMibspiHandle[MSS_SPIB_J16], &spiTransaction);
            if ((transferOK != SystemP_SUCCESS) || (spiTransaction.status != MIBSPI_TRANSFER_COMPLETED))
            {
                DebugP_log("AD738x SPI data conversion first read failed!\r\n");
                DebugP_assert(FALSE);
                return;
            }
    
            // Parse channels from received buffer
            adcResults[0] = ((int16_t)rxBuf[0] << 8) | rxBuf[1];  // Ch1
            adcResults[1] = ((int16_t)rxBuf[2] << 8) | rxBuf[3];  // Ch2
            adcResults[2] = ((int16_t)rxBuf[4] << 8) | rxBuf[5];  // Ch3
            adcResults[3] = ((int16_t)rxBuf[6] << 8) | rxBuf[7];  // Ch4
    
            // Store results in adcBuffer
            for (int ch = 0; ch < NUM_CHANNELS; ch++)
            {
                adcBufferRaw[i][ch] = adcResults[ch];
                /// convert
                adcBuffer[i][ch] = ((float)adcBufferRaw[i][ch] / 32768.0f) * 3.3f;
            }
    
            // Print if needed
            DebugP_log("%4d\n", adcResults[0]);
        }
    
        DebugP_log("Finished data conversion loop, stored %d samples.\n", NUM_SAMPLES);
    }
    

    For the NOP and FFTs, sure I will not talk them in this thread. If needed, I will create a new one.

    Base on my AD738x_dataConversion(), I got following kind of signal. 

    Do you have any suggestions? Do you think there is under sampling issue?

    I will do more test and provide you some other information later.

    Best regards,

    Lin

  • Hi Jo,

    Is there any update for my above questions?

    Also, can we use a QSPI to control AD7380-4 with 4-wire mode?

    Thanks,

    Lin