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 and Bus Pirate

Other Parts Discussed in Thread: ADS1298

I know you all as a company don't work with anything as out there as the Bus Pirate, but its a good gadget for interfacing with new chips. I am trying to make sense of the data coming from the ADS1298. I've written all the registers, and read them back to confirm. I'm starting and stopping conversion fine. And I've even coded 0xE into the GPIO registers and set them to output so that the first 24bits on the conversion should read like 0xC0000E (and it does), but all that follow are varying lengths of data. I know that the Bus Pirate variable is one that you can't account for, and indeed the problem may lie there, but assuming for a moment that is functioning as it should, what could I be missing with the chip's config?

[ = CS low

] = CS high

therefore:

[0x11]  #SDATAC

[0x43,0x00,0xC0] # Wreg Config 3 for 0xC0

[0x41,0x00,0x86] # Wreg Config1 for 0x86

[0x42,0x00,0x10] # Wreg Config2 for 0x10

# Here I'm only trying to get a test signal from channel 1 and shorting all the others

[0x45,0x00,0x05] # Wreg Ch1Set 0x05

[0x4[6-c],0x00,0x01] et cetera 

[0x10]

start reading 24+24 Sclocks (Im only doing 24+1*24 because I am only reading one channel. I think this is right per another post)

Normally I dont like to bother you all with stuff that's probably a forehead slapper, but I am running out of summer ...

***EDIT***

I'm getting output like the following:

... 0xC0 0x00 0x0E 0x00 0xC0 0x00 0x0E 0x00 0xB3 0xC0 0x00 0x0E 0x00 0xC0 0x00 0x0E 0x00 0x9D 0xC0 0x00 0x0E 0x00 0xC0 0x00 0x0E 0x00 0xA5 0xC0 0x00 0x0E 0x00 0xB4 0xC0 0x00 0x0E 0x00 0xC0 0x00 0x0E 0x00 0xA8 0xC0 0x00 0x0E 0x00 0xC0 0x00 0x0E 0x00 0xCB 0xC0 0x00 0x0E ...

The 0x0E here is the tail end of the GPIO registers I tagged so I could make sure I was getting the status bytes ... So it looks like Im getting a header 0xC0 0x00 0x0E way too frequently. I would think, with one channel, I should be getting first 24 bits (0xC0 0x00 0x0E) followed by the square wave test signal 24 bits (0xXX 0xXX 0xXX). Or, if my assumption is incorrect, then the status 24 bits followed by 8*24 bits for all 8 channels. 

Thank you in advance,

JG

  • Hi JG,

    Welcome to the e2e forum!  No Bus Pirates here, but it does look like a handy little tool, I prefer the LogicPort myself.

    If you are able to write/read to/from the ADS1298 registers, I suspect your SPI clock polarity and data phasing is correct.  How fast is your communication to the ADS1298?  I ask because if you deconstruct your data array, it definitely seems like you are not reading out all of the conversion results.  It looks to me like you are getting the status word plus an occasional byte or two of data:

    0xC0 0x00 0x0E 0x00; 0xC0 0x00 0x0E 0x00 0xB3; 0xC0 0x00 0x0E 0x00; 0xC0 0x00 0x0E 0x00 0x9D; 0xC0 0x00 0x0E 0x00; 0xC0 0x00 0x0E 0x00 0xA5; 0xC0 0x00 0x0E 0x00 0xB4; 0xC0 0x00 0x0E 0x00; 0xC0 0x00 0x0E 0x00 0xA8; 0xC0 0x00 0x0E 0x00; 0xC0 0x00 0x0E 0x00 0xCB; 0xC0 0x00 0x0E 

    Are you running the ADS1298 in RDATAC mode?  I suspect you might be and that you are not reading all of the data from the chip between DRDY pulses.  With only CH1 active, you need to send 48 SCLKS, the STATUS will be the first 24-bits and conversion data on the second 24-bits as you noted above.  Do you have an o-scope handy to look at the SPI bus relative to DRDY? 

  • Yes sir, thanks for the welcome. I am running the ADS is RDATAC mode. It seemed like I might have been getting a better result in single-shot mode, but I haven't fully explored this yet. To answer your question apropos speed, I am running the SPI at 4MHz. 

    I noticed the status word plus the random lengths of data too, though I had not thought of your suspicion (that I wasn't managing to read all of the data in between DRDY pulses). 

    If that is correct, and the BusPirate (BP) says that Im at 4MHz, then it seems I have two options: one, move onto the microcontroller I chose and just plow ahead on the firmware under the assumption I am correctly setting the chip up for RDATAC and just exceeding some inherent limitation in the BP; or two, troubleshoot the BP. 

    Maybe something in between those two solutions would be to goto the single-shot mode and try and read an entire conversion or three of the square-wave test signal, just to confirm the reads. 

    I do not have an o-scope :-/ Im a low budget operation. Im in medical school and hope to get into medical device design after I get my medical degree here in a couple years. 

    Thanks for the prompt response and I look forward to hearing your thoughts,

    JG

    Correction: I was clocking at 1 MHz not 4.

    Update: I lowered the clock to 30KHz. The BP only has four options out of the box: 30, 125, 250 KHz and 1MHz. In bitbang mode, which I am scripting in, it can manage 30kHz, 125kHz, 250kHz, 1MHz, 2MHz, 2.6MHz, 4MHz, 8MHz

    Update: I think the clock is my problem. Reading datasheet. For one channel, with default configs otherwise, would I need just 14KHz?

    PS: Sir, does the chip cut out the words for the other channels when you short them (0x01)? i.e., does the formula 24+n*24 vary per chip configuration of channels, or just between chips that lack channels? i.e, does a 8 channel chip ALWAYS read at 24+8*24 bits, or can you lower this on an 8 channel chip? 

  • Hi JG,

    You need the status - that's 24-bits regardless of the chip.  That comes out first followed by data from CH1 to CHx.  If you are only using 2 channels of the ADS1298, assuming they are CH1 and CH2, you need 24-bit * 3 - one status and two data.  If you are using CH7 and CH8, you need 24-bit * 9 - one status and eight data.  Even if a channel is disabled, you still need to provide clocks for that data register.