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.

ADS1158: Missing channels in Channel Data Read Command sequence

Part Number: ADS1158
Other Parts Discussed in Thread: ADS1248

Hi,

I am using an ADS1158 to convert 15 analog channels in Auto Scan mode, and START pin is always enabled.  I read data using Channel Data Read command, as described in p.29 of SBAS429D document.  Every 4 ms I send a series of 15 commands to get the Channel Data.  SPI clock frequency is 3MHz.

I am not getting the information of the 15 channels on every cycle.  I only get the information of 6-7 channels, but don't get information of the rest.

What can I be doing wrong?

Thanks in advance.

  • Antonio,



    Offhand, I'm not sure what the problem is. However, there are several things I would check.

    First, I'd start with a read back of the registers for the ADS1158. If the registers are programmed incorrectly, then the Auto Scan might go through the wrong channel setup. Read back all the registers, but make sure the Auto-scan is set up and also make sure the MUXDIF, MUXSGO, MUXSG1, and SYSRED are all set to the correct registers. Post the results back so we can refer to them.

    Look at the data coming out. Do certain channels reliably output data, while other channels are skipped? I assume that you are reading the STATUS byte to verify the channel with the data. Is the number of skipped data consistent? Is the data correct?

    Last, I'd get a logic analyzer and verify the output of the ADC. Is it possible that the output data is all coming, but your microcontroller or system is only capturing part of the data and losing the rest of it?

    For the ADS1158, the sequence of the Auto Scan should be a simple state machine with steps moving from one channel to the next. It shouldn't miss channel steps as programmed in the registers. If this is a problem with programming, or a problem with losing data, we should be able to debug the error.



    Joseph Wu
  • Hi Antonio,

    Welcome to the TI E2E Forums!

    The ADS1158 is a multiplexed ADC and only converts one channel at a time. Each time /DRDY goes low you are able to clock out only the data from the most recent conversion channel.

    Therefore, to read data from all 15 channels you would need to first enable all of the channels in the MUXSG0 and MUXSG1 registers, wait for a single channel conversion to complete, clock out the data, wait, clock out the data, etc. After all 15 channel data are collected, the ADS1158 will restart it's scan back at the first channel.

    Note: The ADS1158 does not have any internal memory buffer, so if you don't clock out data during a conversion period (before the next /DRDY completes) that conversion data will be lost. In this case you would either need to allow auto-scan to continue cycling through all of the channels, or you would need to reconfigure the registers to start converting at the desired channel and wait for another conversion to complete before reading the desired channel data.

    Best regards,
    Chris
  • //For ADC2
    CS2_Low();
    Delay_ms(1);
    SPI_SendData8(SPI1,ADS1248_CMD_RESET); Delay_ms(5);
    SPI_SendData8(SPI1,ADS1248_CMD_SDATAC); Delay_ms(1);

    ADS1248WREG(ADS1248_REG_MUX1,ADS1248_REG_MUX1_VALUE); Delay_ms(1);
    ADS1248WREG(ADS1248_REG_SYS0,ADS1248_REG_SYS0_VALUE); Delay_ms(1);
    ADS1248WREG(ADS1248_REG_VBIAS,ADS1248_REG_VBIAS_VALUE); Delay_ms(1);
    ADS1248WREG(ADS1248_REG_IDAC0,ADS1248_REG_IDAC0_VALUE); Delay_us(10);
    Delay_ms(1);
    CS2_High();


    //For ADC1
    CS1_Low();
    Delay_ms(1);
    ADS1248WREG(ADS1248_REG_MUX1,ADS1248_REG_MUX1_VALUE); Delay_ms(1);
    ADS1248WREG(ADS1248_REG_SYS0,ADS1248_REG_SYS0_VALUE); Delay_ms(1);
    ADS1248WREG(ADS1248_REG_VBIAS,ADS1248_REG_VBIAS_VALUE); Delay_ms(1);
    ADS1248WREG(ADS1248_REG_IDAC0,ADS1248_REG_IDAC0_VALUE); Delay_us(10);
    Delay_ms(1);
    CS1_High();

    ADS1248_REG_MUX1_VALUE 0x20 //Refernce selection - refer ADS1248 datasheet
    ADS1248_REG_SYS0_VALUE 0x03 //PGA = 1; SPS = 40
    ADS1248_REG_VBIAS_VALUE 0x00
    ADS1248_REG_IDAC0_VALUE 0x06 //1mA IDAC

    if(Ch<5)
    CS1_Low();Delay_us(50);ADS1248WREG(ADS1248_REG_IDAC1,ChannelIDAC[Ch]);CS1_High();Delay_us(10); //Defining current injection for perticular channel
    //
    CS1_Low();Delay_us(50);ADS1248WREG(ADS1248_REG_MUX0,ChannelCommands[Ch]);CS1_High();
    else
    {
    CS2_Low();Delay_us(50);ADS1248WREG(ADS1248_REG_IDAC1,ChannelIDAC[Ch]);CS2_High(); Delay_us(10);
    CS2_Low();Delay_us(50);ADS1248WREG(ADS1248_REG_MUX0,ChannelCommands[Ch]);CS2_High();

    there are other commands through spi for reading converter value.
    the converter value is then caliberated as temperature using polynomial curve.
    the issue is while switching both channels together i m getting a reference of 4 V across reference register instead of 2 V.

    all the values are ambigous.while with single chip operation the converterd and caliberated values are correct.
  • Thanks, Joseph, for your fast answer.

    I do read back registers for ADS1158 and they are programmed as intended.  I am sending the values for the configuration registers:

    - CONFIG0: 0x16 (Status Byte enabled, Chopping enabled, Clock output disabled, use external ADC inputs, Auto-Scan mode, Reset with 4096fclk cycles)

    - CONFIG1: 0x03 (Standby mode, no delay, sensor bias current source off, Data rate 0b11.

    - MUXSCH: 0x00

    - MUXDIF: 0x00

    - MUXSG0: 0xFF

    - MUXSG1: 0xFF

    - SYSRED: 0x00

    I verified the output of the ADC with an oscilloscope, and what I see is that, sometimes, the ADC sends the value of the same channel as the answer for two consecutive Channel Data Read Commands.  For example, I receive 0x8B as status channel in the answer for a command, and receive 0x0B as status channel in the answer of the following command, and then 0x8C, and 0x0C, and so on... So it seems that the ADC is not stepping to the next channel between two consecutive Channel Data Read commands.

    Thanks in advance for your help.

    Regards,

    Antonio

  • Hi Antonio,

    Antonio Agenjo said:
    I verified the output of the ADC with an oscilloscope, and what I see is that, sometimes, the ADC sends the value of the same channel as the answer for two consecutive Channel Data Read Commands.  For example, I receive 0x8B as status channel in the answer for a command, and receive 0x0B as status channel in the answer of the following command, and then 0x8C, and 0x0C, and so on... So it seems that the ADC is not stepping to the next channel between two consecutive Channel Data Read commands.

    This would be the expected behavior of the ADS1158 if you re-read the same conversion data before the next conversion completes.

    The "0x80" value in the upper nibble tells you if the data is new or if you are re-reading the last conversion result.

    I think you're expecting the ADS1158 to provide new conversion data each time you issue a read command; however, there will be a certain time required for the ADC to switch channels and provide a conversion result of the new channel (as is indicated by the /DRDY signal). Since you're enabling the CHOP bit in the CONFIG0 register, conversion data will only appear at about 11.8 kSPS. If instead you disable chopping (i.e. CONFIG0 = 0x12), you'll see the ADC's output data rate increase to 23.7 kSPS.

    Best regards,
    Chris

  • Does this mean that there is only one register to store conversion data? I thought there was a register for each channel, where registers stored conversion data of each channel, and that everytime I asked for data, I got the data from one channel and the channel pointer moved to the next register.

    What I wanted to do was letting the ADC converting in Auto-Scan mode, and ask for the values periodically, where the period is bigger than the time needed to convert the 15 channels. If the ADC stored the 15 conversion values, I could ask for them sequentially, without needing to wait for conversion time.

    So, if I want to get new data from the 15 channels I have to wait for 1 channel conversion, then read it, and repeat this process, am I right?

    I cannot use interrupts in my system, so I cannot use /DRDY as an interrupt source to launch the Channel Data Read when it is ready, and the sw has to do lots of computation in each cycle, so waiting for each channel conversion is too time-consuming...

    What would you think could be the best approach?

    Thank you.
  • Hi Antonio,

    That is correct, the memory depth of the ADS1158 is such that reading data only returns the most recent conversion result. I'm not aware of any high-chnanel count precision ADCs that are able to store the data of multiple channels.

    To get data from all 15 channels on the ADS1158 (without missing results) would require either using the /DRDY interrupt or frequently polling the ADS1158 (at least as often as the conversion period) to read the data. Using the /DRDY interrupt would be the recommended method for retrieving data as it is less processor intensive.

    If you don't need capture every conversion result with high throughput, then you might consider using auto-scan mode with pulse conversion mode. In this mode your microcontroller would control the start of a new conversion and then the ADS1158 would only capture one conversion and wait. Your microcontroller could then read the data and issue a new start command, so that you are able to cycle through all of the channels at whatever rate you have bandwidth to process.

    Best regards,
    Chris