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.

ADS1220 Timing - Multiple Channels

Other Parts Discussed in Thread: ADS1220

Hello,

We are trying to use the ADS1220 to read from two sets of channels, and have some issues working out the right timing and set of commands to achieve the sampling rates required:

AIN0/AIN1 are a differential input using the PGA at 16x gain.  Must sample at least 200sps, cannot process more than 300sps.

AIN2/AIN3 are a single ended measurement (AIN3 at GND), bypassing the PGA at 1x. Must sample at least 1Hz.

Presently, we are doing the following:

  • ADS1220 is configured to 1000sps from AIN0/AIN1
  • MCU reads every 4th sample
  • Once per second, MCU stops ADC, switches all settings to the second set of inputs, and sets a single shot reading.
  • MCU reads the result of the single shot, sets the registers back to the first configuration, and starts it in continuous mode.
  • MCU reads the next sample.

The last three steps work out fitting within the 4msec window for sampling the first input at 250sps.

My concern is that, by using a sampling rate of 1000sps and throwing out 3 of 4 samples, we are not filtering as well as we could if the ADC were configured to 220sps.  However, switching to 220sps leaves us with the question: how to make that second channel sample while not disturbing the first channel's even sampling rate?

Please let me know if further clarification is needed - the above may not be clear.

Thanks for your time.

  • Hi Kevin,

    If you are throwing away samples are you actually collecting the data and only using 1 of 4 conversions or are you just ignoring that data is available and just reading from the ADS1220 once every 4 conversion cycles?  If you are actually collecting the data you could average the conversions together to reduce the noise, but it sounds from the description that you cannot collect the data any faster than 300sps.

    What is not clear to me is your overall required timing.  The ADS1220 does not have a 220sps setting.  It does have a 330sps setting which would be an improvement over 1000sps and throwing away 3 as for this case you would only throw away 2.

    Another option would be to use an external clock to derive different data rates.  The data rates shown in Table 18 of the datasheet are derived from a 4.096MHz clock.  These data rates will scale with frequency of the clock applied.  So you can skew the data rates for 330 sps to 250 sps by reducing the clock frequency to about 3.1MHz.  Using a standard oscillator frequency of 3.088 MHz this comes out to be 249 sps (330 sps * 3.088/4.096).

    Best regards,

    Bob B

  • Hi Bob,

    Thank you for the prompt response.  You are correct - I'm not sure where I got the 220sps number from.  We are currently collecting 250sps by ignoring 3 of 4 samples at 1000sps.

    For the purposes of this timing discussion, let's use the 175sps number.  The timing then might look something like this:

    Channels AIN0/AIN1: continuous conversion

    Channels AIN2/AIN3: single shot

    1. After 175 samples from AIN0/AIN1, stop the conversion.
    2. Switch to Channels AIN2/AIN3 and trigger a single shot at some fast speed.
    3. When AIN2/3 is done, collect the sample and start AIN0/1 at the same continuous conversion speed
    4. 1/175 sec later, AIN0/1 is ready.

    The minimum time between the 175th and the 176th sample on AIN0/1 in this scheme would be (1/175) + (the time to execute step 3 above).

    I think the options are:

    • Skip one sample eachsecond and interpolate
      • This requires the MCU clock to start the continuous sampling again on time.
    • Make the 176th sample at a faster conversion rate (i.e., 1000sps instead of 175, so it's done faster).  Then, switch back to 175sps for the 177th conversion.

    What do you recommend we do?  I am concerned that we are losing some filtering functionality and possibly introducing frequency domain issues by essentially decimating without first low pass filtering.  Is the only answer to low pass filter in hardware?

  • Hi Kevin,

    The FIR digital filter has some differing filter characteristics based on data rate.  Typically there is a notch at the data rate frequency, and additional notches and amplitudes will exist depending of the data rate.  The filter characteristics are shown in various figures starting on page 25 of the ADS1220 datasheet.

    It is best not to solely rely on the digital filter alone as some signals may alias back into the pass band.  Usually all that is required as an anti-aliasing filter is a simple single pole RC filter.  The sampling frequency at the input of the ADC is the modulator frequency (256kHz for normal mode and 512kHz for turbo mode). The output data rate is the rate of the filtered conversion result.  As I just mentioned earlier, the data rates will have differing bandwidth/filter characteristics.

    Adding an external low-pass filter will reduce aliasing effects and depending on cutoff frequency may add some additional filtering of external noise sources.  When connecting series resistive elements such as a resistor for an RC filter you will add a low pass filter.  Resistive bridge elements, as well as the resistance in the wiring will also create a low-pass filter of the excitation source through the sensor.  So in this second case there would be an external low-pass filter.

    Generally speaking with near DC measurements, you want to have the highest precision measurement (based on the lowest possible peak-to-peak noise) which will occur at the lower data rates for Delta-Sigma ADCs.  What data rate you choose will be based on the timing requirements and the ability to reliably read from the ADC.  You may find that averaging 4 samples at 1000sps may have a better response than a single conversion result at 330sps.

    So what is not yet clear to me are your requirements as to how often you need to read from the sensor.  In the end this will largely determine the data rate required.  Is it possible to set the ADS1220 to 20sps and read 19 times from the AIN0/AIN2 inputs and on the 20th read AIN2/AIN3?  That would give you better filtering response than using 1000sps and reading once every 4 conversions for 250 times per second.  However if you need that much bandwidth, then you would require the faster data rate to see a specific input change.  If you do require the faster data rate, then I would suggest using a moving average of the data to lower the noise.

    Best regards,

    Bob B

  • Hi Bob,

    Thank you for the detailed response.

    Your response jogged one question: 

    Presently, once per second, we stop the continuous conversion, change the ADC settings (disable PGA, change channels, and set single shot), then switch it all back and start up continuous again.

    Is it possible to leave the continuous conversion running, but disable the PGA and switch the input channels? If so, how can the MCU tell which settings were used to generate a given sample (if, i.e., a register is changed and then DRDY pulses - is it valid on the NEXT DRDY pulse)?

  • Hi Kevin,

    Yes, you can just leave the ADS1220 in continuous conversion mode and write the new configuration into the device and this will restart the conversion so that the next DRDY will be the new conversion result.  See section 8.4.2.2 in the ADS1220 datasheet.  You can always send the START/SYNC command and this will also restart the conversion while in continuous conversion mode (section 8.5.3.2).

    Best regards,

    Bob B