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.

ADS8331/2 ADC converter digital command to read from a specific channel

Other Parts Discussed in Thread: ADS8332

Hi,

I am using ADS8332 to do ADC conversion. I am just a bit confused by its manual, which does not give some example on what is the exact digital command to read data from a specific channel.

I am able to use my micro-p to generate SPI signals to the ADC converter, which I monitor by a scope. Based on its commands set in Table 4 of its manual, I tried to issue 0x0000 ~ 0x0700 to read channel 0 ~7 one by one; however, I got exact same reply.

I've used SPI/I2C to talk to some other devices before. That device has a register holding a known value, which can be used to test if SPI or I2C interface is working. 

I am wondering if TI's ADS8332 has something for me to validate my SPI interface. From the scope, I could see the signals from my micro-p are what I want, but I don't know whether the reply signal is correct or not.

  • Hello,

    Welcome to the TI E2E forum and thanks for choosing TI.

    ADS8332 register interface is made of two parts. 4 bit CMR (command register) & 12 bit CFR (configuration register). You need to program CMR for any activity while CFR can be optional based on CMR programmed.

    The CMR location is bits 15:12 in the 16 bit data to be programmed. The CMR also determines which channel is sampled by the device in Manual channel mode.

    Hence if you want to manually cycle through each channel, the commands to execute are 0x0000 (for channel 0) to 0x7000 (for channel 7). In your current configuration, the bits from 11:8 are being changed instead of 15:12. Hence you are always sampling ch0.

    To verify you SPI communication with the device, you can configure the CFR by executing the command "0xEyyy" where yyy is 12 bit CFR data. The description for CFR bits is available in Table 5.

    You can then execute command "0xCxxx". Read the value available on the SDO. The 12 bit data should match yyy value programmed before.

    Do let me know if this helps.

    Thanks & Regards,
    Shridhar.
  • Hello Shridhar,



    Thanks for your reply. I've already figured out the way to verify my SPI signals, which is similar to what you suggested.

    I sent out "0xE4FF" to configure CFR; and next round after sending "0xC000", I am able to get back 0xX4FF. What is that four bits X?

    My next question is: what is the CFR values for me to do manual cycle through each channel? Is D11 BIT='0' enough? Can the ADC conversion happen automatically, because I really don't want to program one more PIN to act as CONVST?
  • Hello,

    For manual conversion you need to write CFR once with D11 BIT = 0 & other settings in CFR acc to your application need.

    After this writing CMR with 0x0 to 0x7 (4SCLK write) or 0x0000 to 0x7000 (16 SCLK write) will help you choose the channel.

    You can get away with not using CONVST if you program the device to Operate in Auto_Trigger mode (please refer CFR bits D9 & D8). This mode is useful if you want to capture multiple samples of the same channel. If you want to cycle through all channels with every next sample, I will recommend using CONVST signal.

    Please refer "Start of a conversion" section on page 22 of the datasheet.

    Thanks & Regards,
    Shridhar.
  • Hi,

    In my application, though I need to sample ADC data from 6 channels, I just need at least 50 Hz of sampling rate. So I don't mind polling the channel one by one.

    I set CFR D11 = '0', D9 = '0', D8 = '0'. I can only get correct value of ch0; why the rest channels seem not working. Thx.

    Kind Regards

    dajiang

  • Hello Dajiang,

    With above settings you are entering Manual mode with Auto trigger facility. As explained, this mode is useful to capture multiple samples continuously for the selected channel.

    Since the requirement here is to cycle through the channels, it will be appropriate to use manual trigger with CONVST signal control.

    With Auto trigger mode when you want to change the channel, it is recommended to get into manual trigger mode change channel & then reenter auto trigger mode.

    Please share a list of register writes performed when reading channel 0 data & then moving to read channel 1 or channel x data.

    Thanks & Regards,
    Shridhar.
  • Hello Shridhar,

    Following your advice, now I am able to read data from different channel. The following is what I do:

    1) Tx 0xE7FF to change ADC to manual trigger mode

    2) Tx 0x1000 to select ch1

    3) Tx 0xE4FF to change ADC to auto trigger mode

    4) Tx 0x1000 to read data of ch1

    I believe I can read from other channels by doing the above 4 steps.

    With regard to manual trigger with CONVST signal, I still have not figured out the proper procedure. My platform is Linux and I am using its driver to talk to the ADC chip , so it is not so easy for me to add some code to toggle another PIN besides SPI ones to do try-and-error. 

    Thanks a lot for your help.

  • Hello Dajiang,

    Good to know that you are able to read from different channel.

    You can follow above 4 steps when you plan to change the channel.

    Thanks & Regards,
    Shridhar
  • sir i am cuurently interfacing the ADs8332 how should i send 2BYTES ???? i tried this approach but not get expected result when i write E4FF and then read in DEBUGGER RXbuffer value shows 0x00FE.

    unsigned char mosi[2]={0xE4,0xFF};


    unsigned int spiSend(unsigned char *pucData, unsigned char ucLength)
    {
    while(ucLength)
    {
    // Wait for TX buffer to be ready for new data
    while(!(UCA0IFG & UCTXIFG));

    // Push data to TX buffer
    UCA0TXBUF = *pucData;

    // Update variables
    ucLength--;
    pucData++;
    }


    }


    spisend(mosi,2);