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.

ADS1256 Mux

Other Parts Discussed in Thread: ADS1256, ADS1258, INA333

Using the ADS1256, at a data rate of 500 SPS, and gain of 1, and MSP430

I would like to know more about the proper use of the input multiplexer to obtain data from different/distinct analog sources.

Right now, I have it configured to read data from mux: 05, 15, 25 (using channels 0, 1, and 2, and comparing to channel 5).

Page 21 of SBAS288J -- June 2003 -- Revised August 2008 document describes in part, but I would like to know how long after each command (WREG for mux, SYNC, WAKEUP, RDATA) I should wait before I read the data from DOUT.

Should I issue a calibration between every mux change??, I could not find this mentioned on page 21, but I have read that calibrations should be issued after every MUX change

Also if it is even possible to accurately, almost simultaneously (within the cycling throughput) get distinct data from different channels.

I have included my pseudo code below

Is this basically the right way to go about it? or is there a more efficient/better method? I am not sure if I am giving enough time for the data to settle between MUX changes.

Thank you

Gui

 

my pseudo code so far is:

main:

set ADS1256sampling rate

set gain exponent

do a gain_offset_calibration

set initial gi_current_mux (the positive and negative inputs to the A/D

then start my loop:

   // synchronize to /DRDY
   ADS1256_WaitForDataReady(NO_TIMEOUT);

   // assert Chip Select to start transfer
   ADS1256_AssertCS(TRUE);

   // send the read data command byte
   ADS1256_SendByte(ADS1256_CMD_RDATA);

   //enable the interrupt on the data ready pin
   Config_DRDY_Interrupt ();

in my interrupt:

     reset interrupt port

    ADS1256_QuickWriteMUXRegister(gi_currentMux); //write to MUX register with the value of gi_currentMux (set before loop start, and then goes to next one at end)
    ADS1256_Delay_TOSC(24);  //wait 24 cycles WAIT_1_US()  {asm("nop");}    //at 1MHz DCO , 1 cycle per NOP, each
    ////possibly put a calibration
    ADS1256_SYNC_and_Wakeup();
    ADS1256_SendByte(ADS1256_CMD_RDATA);

   //then I receive each byte and put in a buffer

   //gac_sd_AD_buffer size = 512 bytes

    gac_sd_AD_buffer[gi_sd_AD_buffer_pointer_in]=ADS1256_ReceiveByte();
    gi_sd_AD_buffer_pointer_in++;
   
    gac_sd_AD_buffer[gi_sd_AD_buffer_pointer_in]=ADS1256_ReceiveByte();
    gi_sd_AD_buffer_pointer_in++;
   
    gac_sd_AD_buffer[gi_sd_AD_buffer_pointer_in]=ADS1256_ReceiveByte();
    gi_sd_AD_buffer_pointer_in++;

 

    //then I state machine the value of gi_currentMux to the next mux

 

back to main:

 

In parallel, when not in the interrupt, I empty the gac_sd_AD_buffer into another buffer (also 512 bytes)

when that second buffer is full, i write all 512 bytes to an SD card

I loop until I have filled an N amount of sectors in the SD card

then

     //disable the interrupt on the data ready pin
   Deconfig_DRDY_Interrupt ();

   //now that interrupts on DRDY are disabled, we can poll the pin
   // synchronize to /DRDY
   ADS1256_WaitForDataReady(NO_TIMEOUT);

      // de-assert Chip Select
   ADS1256_AssertCS(FALSE);

 

  • Gui,

    To answer some of your questions in bold:

    "Page 21 of SBAS288J -- June 2003 -- Revised August 2008 document describes in part, but I would like to know how long after each command (WREG for mux, SYNC, WAKEUP, RDATA) I should wait before I read the data from DOUT."

    Your code looks like you are monitoring the /DRDY signal. On page 27 of the data sheet we mention that "DRDY will stay high after exiting Standby mode until valid data is ready. Standby mode can be used to perform one-shot conversions; see Settling Time Using One-Shot Mode section for more details." The /DRDY signal will pulse when the data is ready to be read out. See page 27 for more information on reading out the data using the /DRDY signal. As soon as the data is updated you are able to read it out. 

    Should I issue a calibration between every mux change??, I could not find this mentioned on page 21, but I have read that calibrations should be issued after every MUX change?

    A calibration should be performed following a data rate change, a change to the buffer configuration, or a PGA change. Generally, you will not have to perform a calibration when you change from channel to channel. You may want to run one if there is a substantial difference in the input impedance from channel to channel. It really depends on your system.

    Also if it is even possible to accurately, almost simultaneously (within the cycling throughput) get distinct data from different channels.

    The ADS1256 does not have an auto-scan mode to allow you to cycle from channel to channel instantaneously. You will have to manually command the channel change. Some parts, such as the ADS1258, have an auto-scan mode which will automatically change channels once a channel is converted. 

     

    Regards,

    Tony Calabria

     

  • Tony,

    Wow, I wasn't expecting an answer so quickly, thank you for the quick reply; I had totally darted past it in my emails last night.

     

    Yes, I am monitoring the /DRDY to trigger an interrupt from high to low

    So about Figure 19. "Cycling the ADS1256 Input Multiplexer on page 21, to summarize what I think I should be doing:

    1. I write the to the MUX register, wait 4 TCLKIN

    2. Issue a SYNC command, wait 24 TCLKIN

    3. Issue a WAKEUP command, wait 0 time

    4. Immediately issue a RDATA, wait 4 TCLKIN

    5. Then I start reading the data from the RX SPI buffer

     

    Please correct me if the above steps are wrong.

     

    You mentioned the "Buffer Configuration"--what is that?

     

    Hmm, maybe I'll look into the ADS1258 for a future stage, for now I only need to read from 3 channels at about 100-200Hz each so I think the ADS1256 is enough for now (plus I already spent a ton of hours on it).

    Thank you,

    Gui

     

  • Gui,

    The ADS1256 has the option to enable a built in buffer. The block diagram on page 1 of the data sheet shows that the buffer is located between the built in mux and the built in PGA. We recommend enabling the buffer if your input comes from a low impedance source. If you do decide to enable the buffer then a calibration should be performed. In fact, every time you enable or disable the buffer we recommend running a calibration. Keep in mind, enabling the input buffer will reduce the input range of your analog signal. See the Electrical Characteristics on page 3 - with the buffer enable, your input range is limited from AGND to AVDD − 2.0V. See page 15 for more information on the input buffer. By "Buffer configuration" I meant enabling / disabling the input buffer.

    You may want to reference page 20 of the data sheet for Data Retrieval After Synchronization. Depending on your data rate setting and what you master clock (fclkin) is set to, their is a time limit (settling time, t18) you will need to wait before /DRDY will drop and you can do a Read Data command. Make sure you issue the Read Data (RDATA) command after /DRDY pulses indicating valid data is ready.

    Your first 3 commands look like they are timed right without any issues. The timing for commands 4 and 5 are dependent on your ADC settings. Make sure /DRDY pulses before you issue a RDATA command.

    Regards,

    Tony Calabria

     

     

     

  • Hmm, I didn't see the AVDD -2V part, thanks for pointing it out. If my AVDD is 5V, how high could my AIN be without permanently breaking the A/D inputs? Do the ESD diodes only protect for a relatively quick burst of high voltage?

    The only way to enable buffer is with the WREG command right?

    I am using the buffer disabled as default, but maybe the performance will improve if I enable it; I am measuring EOG and EKG biosignals-noisy mV range signals (using INA333 to filter and amplify first though).

    I have the INA output directly into the A/D input.

    We try to keep the impedance usually between 2K and 10K ohms

    My fCLKIN = 7.68MHzm and SPS = 500, so I must wait 2.18ms for settling time, or 16743 tCLKIN

     

    So, I'm actually following page21 because I want to cycle between channels.

    More complete detailed steps:

    1. DRDY goes low --> triggers an interrupt

    2. I switch to mux 06h for example (wait 4 tclkin)

    3. SYNC (wait 24 tclkin)

    4. DRDY goes high and starts conversion on mux 06h

    5. WAKEUP (wait 0 time)

    6. RDATA (so that I can read data from mux 16h) (While DRDY is still high) (wait 4 clkin)

    7. receive data from mux 16h

    8. Wait for however long (estimated: 16743 tCLKIN - 32 tCLKIN = 16700 tCLKIN )

    1. DRDY goes low and I restart the cycle.

     

    Since I am only looking at DRDY only when it goes low, I don't have to "worry" about waiting for 2.18ms (t18)

     

    Thank you again,

    Gui

  • Gui,

    Answers to a few of your questions are below:

    If my AVDD is 5V, how high could my AIN be without permanently breaking the A/D inputs? Do the ESD diodes only protect for a relatively quick burst of high voltage?

    ESD stress testing is done with short bursts of high voltages. This part was tested under 1kV momentary stress testing. If you decide to run the part out of spec, we cannot guarantee that the part will not damage and performance will not degrade. The maximum rating specs on page 2 of the data sheet shows that we can guarantee the part to. If the analog input exceeds AVDD + 0.3V, then you may damage your part. 

    As for the Maximum analog input with the buffer enabled. We state that The maximum analog input is AVDD - 2.0V. So if you are using a AVDD = 5.0V, you cannot exceed an analog input of 3.0V. If you do exceed 3.0V, then you will see the performance of the internal buffer decrease. As you increase further away from 3.0V (closer to 5V), the performance will degrade and the buffer will eventually turn off (around 4V). In the Rev. D version of the ADS1256 (currently available), when you bring the analog input voltage back down within AVDD - 2.0V, the Buffer will automatically restart itself.

    The only way to enable buffer is with the WREG command right?

    Yes, the only way to enable and disable the buffer is with the WREG command, by writing to the STATUS REGISTER. When you enable the buffer, you cannot have an analog input signal larger than AVDD-2.0.

    Looking at your detailed steps I do not see an issue with your procedure. Just keep in mind that every time you are reading data, you are reading the data from the previous acquisition.

    Regards,

    Tony Calabria

  • Tony,

    Alright, thanks for all the help. Everything appears to be working well in my project.

     

    -Gui

     

    ps. I'll probably be back on in a couple of weeks asking about the ADS1258..