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.

ADS1251: how can I make sure the SCLK is provided when DOUT is at Data Output (DOUT) mode?

Part Number: ADS1251
Other Parts Discussed in Thread: ADS1261, ADS1255

Hi,

Now my customer is testing ADS1251, CLK is 6MHz, and 32 SCLK is generated every 100us. So the 32 SCLK can locate at either DRDY mode or DOUT mode. And we will get wrong data every 5 data as shown below:

Do we have example code?

  • Hi Howard,

    It seems like the customer is reading the nDRDY pulse as data, since "517121" (decimal) corresponds to "000001111110010000000001" (binary), which is likely sampling DRDY during the t4, t2, and t3 periods.

    Is the customer still trying to MUX between multiple ADCs or are they only reading data from one ADC? In either case, they will need to meet the timing specifications of reading data and take care not to read DOUT/nDRDY while it is in the nDRDY mode.

  • To answer your question about example code, we don't have any example code for this device currently.

    I would recommend creating a /DRDY falling edge interrupt (to detect when the "t2" period begins). As soon as this interrupt occurs, disable the interrupt, wait 12 clock periods (to allow the ADS1251 to exit nDRDY mode), clock out 24 bits of data with SCLK, then re-enable the falling edge interrupt (to detect the next /DRDY) and repeat.

  • Chris,

    thanks.

    So according to your suggestion, we need to route /DRDY pin to dedicated XINT(external interrupt) pin of MCU, right?

    If that's the case, I doubt why we design such a communication interface, it can save neither hardware nor software resource of MCU.

  • Hi Howard,

    DOUT/nDRDY is a single pin with dual functionality. It should already be routed to the MCU one way or another. You can either:

    • MUX the MCU's GPIO pin function to catch the interrupt (as a GPIO) and then use it to read data (as a SPI).

      or

    • You can route this signal to two MCU pins and dedicate one pin to each function (GPIO interrupt and SPI MISO).

      or

    • If you can guarantee an accurate timer (perhaps one that relies on the 6 MHz ADC clock), you can time how long it would take for the ADC conversion to complete and only read data while the ADC is in DOUT mode.

    The ADS1251 is a very simple device that provides data as conversions are completed; however, as a trade-off to this simplicity the MCU needs to be programmed to read data at the correct time. More complex ADC's such as the ADS1255 or ADS1261 will allow you to read out data at any time, re-read the last conversion result, or perform single-shot conversions whenever requested by the MCU.