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.

ADS1298: Data retrieval

Other Parts Discussed in Thread: ADS1298

Hello,

I had a question regarding data acquisition from the ADS1298. I'm currently trying to interface a pic with the ADS1298ECGFEPDK via SPI and am only wanting to use channel 3. I know about this formula: tSCLK < (tDR – 4tCLK) / (NBITS × NCHANNELS + 24). However, I wanted to make sure I understood how to set tSCLK. Is it correct to say that because I want to get only channel 3, that NCHANNELS = 3 and NBITS = 24? Also, by setting  TSCLK to this value, does this mean that I will get the data in channels 1,2, and 3 (knowing that because I've disabled channels 1 and 2 they should just give 0x0)?

I also wanted to ask a question regarding code. What I currently have on my PIC is after the RDATAC command is sent and 4tCLK cycles have passed, I set a variable called data = SPI2BUF, which should ideally be holding the transmitted data. However, after debugging a few times, I get that data = 0x00, which may be due to the fact that SPI2BUF is shifting the data too quickly. Is there a better way of storing the data from the ADS1298 in a variable?

Thanks,

Noel Teku

  • Hi Noel,

    The ADS1298 will output 8 channels worth of 24-bit data plus the 24-bit status word = 216 total bits. If you wish to read ALL of this data, your minimum SCLK speed is calculated using the formula above. As long as you send 216 SCLK pulses before the next /DRDY pulse arrives, then you will be able to read all of the data just fine. All powered-down channels will output 0x00s like you mentioned.

    You could send fewer SCLKs if you do not wish to read all of the data; however, in order to read CH3, you must first read STATUS + CH1 + CH2, then CH3. This requires 4 x 24 = 96 SCLKs. Then, you must take /CS high to reset the interface, and return /CS low after the next /DRDY pulse as you would normally.

    I don't really know much about the PIC processors, so I cannot provide much help there. If you wish to verify that you are getting valid data from the device and not all 0x00, the easiest test would be to probe the SPI output pins (i.e. /CS, SCLK, /DRDY, DOUT) with an oscilloscope or logic analyzer to see what the correct variable values should be.

    Best Regards,
  • Hi Ryan,

    Thank you so much! This makes sense, but I do have some more questions. Is the STATUS word you mentioned referring to page 53 in the datasheet where it says that, "The status word is 24 bits long and contains the values for LOFF_STATP, LOFF_STATN, and part of the GPIO registers"? Also, are you doing 4 *24 = 96 sclks in order to account for this status word? In addition, why do I need to reset the interface after reading the data? Do I need to do this for the ADS1298 to be able to read in new data?

    Thanks again,
    Noel Teku
  • Hi Noel,

    Yes, that is the STATUS word I was referring to. The 96 SCLKs account for the STATUS word plus the first 3 channels.

    Sorry I should rephrase my earlier statement about /CS. When we say that bringing /CS high resets the digital interface, we simply mean that SCLK and DIN are ignored and DOUT becomes a high-impedance output. If you are continuously reading data, it is perfectly OK to leave /CS low the whole time. Once you send 96 SCLKs, you must wait for the next /DRDY pulse to read your new data. The old data (including the channels which you did not read) will be overwritten with new data once you see the /DRDY pin go low.

    Regards,