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.

ADS1257: Communicating with and synchronizing multiple ADS1257s

Part Number: ADS1257
Other Parts Discussed in Thread: ADS1256

Hi,

I wonder if there is a faster way to setup the adc to talk to the microcontroller (ESP32). Generally, do we have to manually setup the timing, the register pulses according to the datasheet of an ADC? 

Also, when I look at the datasheet for this part, there are a few pins that, even after I went through their descriptions, I still don't fully understand.

1. What is the purpose of the SYNC pin. "The SYNC command synchronizes the analog-to-digital conversion." But, isn't SCLK used for that purpose? I assume that the SCLK synchronize the microcontroller and the adc

2. If I have 3 ADS1257 for each microcontroller (I use ESP32 -Thing from Sparkfun), do I need to have 3 separate DRDY output pins that are capable of hardware interrupt?

3. Since I have 3 ADS1257, how would I be able to modify the pseudo-code to accommodate for 2 more ads?

          a. I think from the beginning to the line before LOOP, we will do for all ads1257's

          b. If I switch between ads1257s, I don't need to power them down, right? I will go back to the LOOP and just take the CS pin of the next ads1257 LOW?

4. Where would the DRATE and PGA gain set in this pseudo-code? It is the WREG command after we send the SDATAC command, right?

5. Is there any differences in terms of performance if I measure the signal Single Ended as opposed to Differential mode? Each ads will collect samples from 2 measurements so we also have to MUX each adc as well

6. This might be a naive question, usually digital differential signaling needs 2 pins, one P and one N (like the USB connector). The timing diagrams of DIN and DOUT suggest that they are differential signals, yet I only see one pin for DIN and one for DOUT. I wonder how this works?

7. Finally another naive question, If I set the ADC sampling rate to 1kHz but I have 2 measurements, do I get 1kHz sampling rate for each measurement? Does the LOOP frequency in the pseudo-code have to match with the sampling rate of the ADC? In other words, how would I collect 6 measurements (2 measurements for each adc) at the rate of 1kHz to my microcontroller?

Thank you very much for your support and I look forward to hearing from you soon,

Khoi Ly

Phd in Mechanical Engineering 

University of Colorado Boulder

  • Hi Khoi,

    Setting up an MCU's SPI peripheral shouldn't be an entirely manual process if you are working with an SPI peripheral. Yes there are some timing requirements that you need to pay attention to (such as adding a delay after setting /CS low, or between SPI commands); however once you have the SCLK frequency and SPI mode set correctly, you should be able to start communicating with the device fairly quickly. To answer your questions...

     

    1. The SYNC pin restarts ADC conversions. It is generally used to synchronize multiple ADS1257's so that conversion results from multiples sources can be correlated in time. Alternatively, if you know that your input signal has changed significantly (i.e. a step change), then restarting the ADC conversion can get you a settled result faster as it cancels the current conversion (that would have provided an unsettled result).
    2. Not necessarily. If you synchronize all three ADS1257's then you would only need to monitor one /DRDY signal. Otherwise, if you do not monitor all /DRDY signal OR synchronize the ADC's you would probably need to poll each of the ADCs to determine when data was ready.

    3. Correct in both cases...configure all three ADCs and then when you go to ready data, you would simply loop through reading the data from each ADC. I would not powerdown the ADCs unless you are only wanting to take one reading(for each ADC) and then go into a low-power mode for awhile. Putting the ADCs in powerdown will stop conversions.

    4. Programming the registers should happen after the SDATAC command but before calibration (that is if you perform this step).

    5. Possibly...what is it you are measuring? If you can measure the signal deferentially I would recommend doing so. Keep in mind that to the ADC everything is a differential measurement; therefore, the main difference between these configurations only has to do with when you connect the negative input pin.

    6. DIN and DOUT are SPI signals referenced to DGND. SPI is capable of being full-duplexed (though the ADS1257 is only half-duplex), but otherwise you could be sending a command on DIN while reading out data on DOUT.

    7. Take a look at the settling time shown in table 12. Also keep in mind that since this is a (multiplexed) delta-sigma ADC that the input sampling rate and output data rate are different! When you change the output data rate, you are not sampling the signal any slower, but rather you are changing the decimation ratio of the digital filter.

      Also since you are multiplexing you will only be able to retrieve data as fast as the settling time (i.e. the amount of time it takes to get the first conversion result on a channel). Therefore, to read each channel at at least 1 kHz, you would need to set the output data rate to 3750 SPS. Since the digital filter is averaging many samples and it has to accumulate a certain number of samples to provide a "settled" output (i.e when all the filter taps have data) the output data rate must be set to something higher than 2 kHz to sample each channel at at least 1 kHz.

    I hope that helps!

     

  • Hi Chris Hall,

    Thank you very much for your detailed reply. I would like to follow up with you regarding the previous responses.

    "If you synchronize all three ADS1257's then you would only need to monitor one /DRDY signal."
    Can my sync pin GPIO from uC? Do I connect three ADS1257 SYNC pins to one GPIO of the uC or should they all be separated?
    If I use SYNC feature, do I have one hardware interrupt pin for each DRDY? Your reply is not necessarily, so I assume we only use one uC pin for all three DRDY

    I realize that its cousin, ADS1256, has a well established library for Arduino microcontrollers. Does it have any significant differences compared to ADS1257 besides having more channels? Do you have library files for ADS 1256 and/or ADS1257 that I could use to adapt to my ESP32? I am trying to figure out the most efficient way to establish the SPI connections between ESP32 and the ADS but not sure how to. If you have any suggestions, I would really appreciate.

    Thanks,

    Khoi Ly
  • Hi Khoi,

    I would use a single GPIO pin from the MCU to connect to all three SYNC pins, keeping the trace length(s) to each ADC about the same. This way you guarantee that all three ADS1257's receive the SYNC pulse at the same time.

    If you configure each ADC to operate at the same data rate, you use the same clock for all three ADCs, and you synchronize them at the same time, then the /DRDY interrupts from all three ADCs will occur at the same time and you don't have to monitor each /DRDY signal independently. However, if you have spare GPIO pins there is no harm in connecting all three /DRDY outputs to the MCU to give you the ability to operate each ADC at a different data rate.

    From a programming perspective, the interface is the same and the only difference is in the register map settings. For example, there are fewer MUX register and IO register options but otherwise the same software could be used for both. Unfortunately, we haven't provided much example code for either of the ADS1256 or ADS1257 devices, but you could reference this E2E thread for one additional example: e2e.ti.com/.../1182307