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.

ADS1118: How to minimize programmable delay while executing readings from multiple ADS1118s

Part Number: ADS1118


Hi,

I would like to perform temperature readings from multiple ADS1118s while minimizing total programmable delay as much as possible. I will use five ADS1118s and each will have two TC channels on it. Here is the execution process that I have in my mind:

1- ) Read the data reg. for the conversion of the input signal from the TC connected to the first channel of the first ADS1118.

2- ) Write a new value to Config Reg. to be able to read the value of internal temp. sensor  

3- ) Execute ~8 ms delay (for 128 SPS) for conversion to be completed by the first ADS1118

4- ) Read the data reg. for the internal temp. sensor and perform cold junction compensation

5-)   Write a new value to Config Reg. to read from the second channel of the first ADS1118

6-) Without executing another ~8 ms delay go to the next slave (second ADS1118) and perform 1-5

7- ) Repeat this until the readings from the first channel of all slaves are completed

8-) Execute ~8 ms delay

9-) Repeat 1-5 for the second channel of all slaves.  

As it can be seen, I interleave between the channels to minimize the total programmable delay expecting that each ADS1118 will be still in conversion mode and making the new value ready although their CS pin is taken to HIGH.  Could you please confirm if that is possible or not in continuous or single-shot mode?

Thanks in advance...

  • Fatih,


    I don't think you could do this in continuous conversion mode. Let me explain this for a single device reading multiple channels and then extend the point to multiple devices and channels

    With single shot mode, you can start a conversion and read the conversion after the conversion has completed within the data cycle. Once the conversion has completed, the device goes into a power-down state and can be awakened to start a new conversion with a new configuration. To wake the device to start the conversion will add on about 20us.

    In continuous conversion mode, when you complete the conversion, the data from the device can be read out, but the ADC has already started the next conversion with the same configuration. Any changes to the configuration register will not take place until after the conversion already in progress has completed. In this sequence, you set the device, complete a conversion, read the conversion, set the device, wait for the current conversion to complete, wait for the new configuration to be set and complete the conversion, and then finally read the new data. This could potentially take twice as long to get data.

    To get the best throughput in continuous conversion mode, you could write the new configuration register during the current conversion cycle. In this mode, you must stay in sync with the conversion completion and each conversion result must be read. This is a bit more difficult to keep track of which conversion has completed and which is being read at the time.

    The description above works for a single device, however with multiple devices, the devices all have different internal oscillators and there will be some variation in data rate. At some point, the devices will be completely out of sync and the conversions will not be ready for readout or for the next configuration register write. Using single-shot mode, you will be able to do each configuration setup and data read in the same amount of time.

    To be able to sequence all devices and get the fastest throughput, use single-shot mode.


    Joseph Wu
  • Joseph,

    > I see your point but I want to make sure one thing. Suppose that I started a conversion in single-shot mode and read the conversion after the conversion has completed within the data cycle. Lets suppose that was the analog input conversion of  the first channel of the first ADS1118. However, I need to also perform cold junction compensation before I switch to another channel right? For that, new configuration needs to be set for internal temperature sensor reading, which will require conversion delay (~ 8 ms @ 128 SPS). If I remember correctly the datasheet suggests to read these values sequentially before switching to the another channel on the same ADS1118 or another ADS1118. Please correct me if I am wrong. That is one of the things that I want to make sure.

    > After the cold junction compensation of the first channel of the first ADS1118, I have two options:

              1-)  Set the new configuration to read from the second channel of the first ADS1118 and wait  ~ 8 ms for conversion to be completed to read the right data.

              2-)  Set the new configuration to read from the second channel of the first ADS1118  and switch right away to the second ADS1118 and read the conversion that is completed through the first channel. In this way, when I get back to the first ADS1118, I expect the new conversion from the second channel is ready to be read.

    I know that the first option is feasible but it will require additional ~8 ms delay.The second option will help to minimize the total delay but according to your statement  that the ADS1118 in single-shot mode will not start conversion until I switch back to the associated ADS1118 and awaken it. Actually, I was guessing so but also hoping that this should be possible in continuous mode. In continuous mode, I was going to write the new configuration register during the current conversion cycle to switch reading to the second channel of the first ADS1118. But, to read the right value I need to wait ~8 ms. Rather than waiting that can not I interleave and select the second ADS1118 through MUX (CS selection) and read the first channel of the ADS1118 as we did for the first ADS1118. Suppose that we have multiple ADS1118, when I repeat this for all ADS1118 and execute ~8 ms only once, I believe the new data converted from the second channel of all ADS1118s are going to be already ready to be read. I am confused taht why it is difficult to keep track of which conversion has completed and which is being read at the time. Could you please elaborate this section. Thanks...

  • Fatih,



    It took me a little time to read through your response to make sure I understood the question, but I have some answers for you.

    fatih cingoz said:

    Joseph,

    > I see your point but I want to make sure one thing. Suppose that I started a conversion in single-shot mode and read the conversion after the conversion has completed within the data cycle. Lets suppose that was the analog input conversion of  the first channel of the first ADS1118. However, I need to also perform cold junction compensation before I switch to another channel right? For that, new configuration needs to be set for internal temperature sensor reading, which will require conversion delay (~ 8 ms @ 128 SPS).

    You do need to perform a cold junction compensation, but it would take about the same amount of time to do this. Note that if the temperature doesn't change much in the 8ms of time, then it's not a problem to have a small delay.

    I think that you should start conversions of all devices at near the same time, and then read back/setup all devices in the same way. This is what I would do for the sequence if you had five ADS1118s, devices labled #1-#5:

    1. Use single-shot mode for all devices. Setup and start first thermocouple conversion device #1, start device #2, start device #3, start device #4, start device #5. With a 4MHz SCLK this would probably take about 10us for each device, taking about 50us total.

    2 Wait about 8.6ms for all conversions to complete. This is 1/128SPS, with 10% added for internal clock variation and 20us for device startup.

    3. Read back all data for each thermocouple 1 and setup conversion for thermocouple 2. Read and setup device #1, Read and setup device #2, Read and setup device #3, Read and setup device #4, Read and setup device #5. (takes about 50us)

    4. Wait about 8.6ms for conversion to complete.

    5. Read back all device for each thermocouple 2 and setup second for cold junction. Read and setup device #1, Read and setup device #2, Read and setup device #3, Read and setup device #4, Read and setup device #5. (takes about 50us)

    6. Wait about 8.6ms for conversion to complete.

    7. Repeat, starting with 1 again.

    This would give you data for two thermocouples for each of five devices and it would take about 26us total. Here, you don't setup and wait for the conversion of any device individually. This allows you to wait for all of them as they complete their conversions at the same time.

    If you were to run the devices in continuous conversion mode, the internal oscillators of all devices running at different frequencies you'll never be able to efficiently start and read data. The devices all could be starting and completing conversions at any time.

    Going back to the sequence I outlined, if you feel like you need the cold junction compensation more often, you could read it between the two thermocouple reads. If you don't need cold junction compensation as often, then you could read this every few cycles and that would give you more data.

    If I remember correctly the datasheet suggests to read these values sequentially before switching to the another channel on the same ADS1118 or another ADS1118. Please correct me if I am wrong. That is one of the things that I want to make sure.

    Can you point where the datasheet says this? I think that this might refer to the read of the data, where after a conversion completes, the data must be read out before next conversion completes. This is true for continuous conversion mode, where the output data register is immediately updated when the conversion completes. If you are in the middle of clocking out data, and a new conversion completes, it will still update the output data register, giving you a corrupted data read.

    > After the cold junction compensation of the first channel of the first ADS1118, I have two options:

              1-)  Set the new configuration to read from the second channel of the first ADS1118 and wait  ~ 8 ms for conversion to be completed to read the right data.

              2-)  Set the new configuration to read from the second channel of the first ADS1118  and switch right away to the second ADS1118 and read the conversion that is completed through the first channel. In this way, when I get back to the first ADS1118, I expect the new conversion from the second channel is ready to be read.

    I know that the first option is feasible but it will require additional ~8 ms delay.The second option will help to minimize the total delay but according to your statement  that the ADS1118 in single-shot mode will not start conversion until I switch back to the associated ADS1118 and awaken it. Actually, I was guessing so but also hoping that this should be possible in continuous mode. In continuous mode, I was going to write the new configuration register during the current conversion cycle to switch reading to the second channel of the first ADS1118. But, to read the right value I need to wait ~8 ms. Rather than waiting that can not I interleave and select the second ADS1118 through MUX (CS selection) and read the first channel of the ADS1118 as we did for the first ADS1118. Suppose that we have multiple ADS1118, when I repeat this for all ADS1118 and execute ~8 ms only once, I believe the new data converted from the second channel of all ADS1118s are going to be already ready to be read. I am confused taht why it is difficult to keep track of which conversion has completed and which is being read at the time. Could you please elaborate this section. Thanks...

    Read through my sequence. I think that the one I talk about would be the easiest, and I don't think that using the ADS1118 in continuous conversion mode would be feasible for multiple devices with multiple channel reads.

  • Joseph,

    Thanks a lot for your response. It was really informative.

    > Regarding the following statement you made " You do need to perform a cold junction compensation, but it would take about the same amount of time to do this. Note that if the temperature doesn't change much in the 8ms of time, then it's not a problem to have a small delay. "

    -- Yes, you are right that the temperature will not change fast but my concern was actually the temperature of the ADS1118 which will effect the readings from the internal temp. sensor an you know. If the level of the analog input signals into the TC1 and TC2 channels are different from each other ADS1118 will heat up to different levels and accordingly my readings from the internal temp. sensor. If that is the case readings from TC1 will be compensated with wrong temp. sensor readings and thus effect the accuracy. In addition to that, when you perform readings as TC and temp. sensor back to back right away without switching to another channel you do not let the ADS1118 cool down to much staying in power down state. Please correct me if I am wrong...

    > Regarding the following statement you made "If you were to run the devices in continuous conversion mode, the internal oscillators of all devices running at different frequencies you'll never be able to efficiently start and read data. The devices all could be starting and completing conversions at any time."

    -- Would I have the same issue you pointed here if I set the SPS of the devices to the same value although they have different internal oscillators.

    -- As I told you earlier I will be using multiple ADS1118s and ADS114S08s and as you know they have different internal oscillators. If I group them and connect them to different SSI modules on the same MCU, would that solve the issue you pointed here. If it will solve the problem you stated above in which cases I could benefit from multiple SSI modules in my MCU. I am asking this because I am using TIVA TM4C129 and it has four SSI modules.


    > Regarding the following statement you made "Read through my sequence. I think that the one I talk about would be the easiest, and I don't think that using the ADS1118 in continuous conversion mode would be feasible for multiple devices with multiple channel reads. "

    -- I will set the ADS1118 to single-shot mode conversion and apply the sequence you suggested and let know you if I face with any issue...

    Thanks...
  • Fatih,


    Just one more comment as a quick response.

    Powering up the ADS1118 shouldn't affect the temperature measurement much. The ADS1118 only dissipates about 0.5mW of power (with a 3.3V supply). With the device thermal resistance, you can calculate that the junction temperature will only go up by about 0.1°C, even if the device is kept on. Turning the device on and off will not affect the cold junction measurement. I used the junction-to-ambient thermal resistance for that calculation.

    Good luck with your system design. If you put together a schematic, post back and we can review it.


    Joseph Wu