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.

  • TI Thinks Resolved

ADS1256: Not able to read and write the values to the configuration registers.

Part Number: ADS1256

hi.

I have ADS 1256 development board and trying to interface with STM32F446ZE using STM cube and SW4 (Eclipse based workspace). 

sometimes i'm able to read the default values from the configuration registers only when i write specific data to the any of the register. I meant after the write command is sent. if i write the data (with LSB bit 1 in it) then i will get the default register value in response to the read command.   if i write the data (with LSB bit 0 in it) then i will get the register value as 0x00 in response to the read command.  

Also i'm not able to write the registers with any values. Here i have attached the SPI communication details captured with logic analyzer.

6201.SPI.zip

Thanks,

Harsha 

  • Hi Harsha,

    Welcome to the TI E2E Forums and thanks for sharing your logic analyzer screenshots!

    I noticed that you are reading and writing to different registers, is that intentional, or did you mean to read back the value that you are trying to program?

    Currently, you are sending the "0x54 0x00" command which writes to the "I/O" register, and when you send the "0x10 0x00" command bytes, you are reading from the "STATUS" register.

    The WREG command is being ignored because the "I/O" register does not allow you to write to the lower nibble bits when the upper nibble bits are all set to "0". Please refer to the I/O register description below:
    I/O: GPIO Control Register description

    Your RREG command is currently only reading the STATUS register. The first result of "0x31" seems valid. Do note that the LSB of this register follows the state of the /DRDY pin, so it may differ between consecutive readings; however, you should still see the same values in the upper nibble. In your second reading it looks like the ADS1256 is not responding to the RREG command. Is it possible that perhaps either the /RESET or /PWDN pins was set low, or for another device on the same SPI bus to also be active during this time? If not, do you see a regular /DRDY pulse on the ADS1256 to indicate that it is active?

    One last and important recommendation... Make sure to send the SDATAC command before you read or write to the device registers. If you are in RDATAC mode, then this device might ignore the RREG and WREG commands. I would recommend sending the SDATAC command first thing to ensure that you are not in the RDATAC mode.

    Best regards,
    Chris


    Christopher Hall
    Applications Engineer | Precision Delta-Sigma Converters

    Check out our helpful resources:
    TI Precision Data Converters | TI Precision Labs - ADCs | Analog Engineer's Calculator | Data Converters Learning Center | Selection Guide

  • In reply to Christopher Hall:

    hi christopher,

    Thanks for the fast reply.
    Yes, it is intentional reading and writing. First i tried only to read the 'status' register but only few times i got the correct response. so i added the WREG commands. I do see a regular pulses on the DRDY pin. RESET and SYNC/PWDN pins are pulled up. only ADS1256 is on the SPI bus.
    I was not using the SDATAC command before reading and writing registers. Now i will check the response after disabling the continuous data read mode and let you know the result.

    Thanks&Regards,
    Harsha B S
  • In reply to Christopher Hall:

    Hi Christopher,

    I have couple of doubts.

    1).How often do we need to do the synchronization process?

    2).What is the difference between self calibration and system calibration? If we issue the SELFOCAL or SYSOCAL commands, the OFC registers are being updated. so which one do we need to perform? and how often do we need to do this calibration?

    Thanks&Regards,
    Harsha B S
  • In reply to Christopher Hall:

    Hi Christopher,
    I have few queries to ask. Please help me!

    Now I'm able to read and write the ADS1256 configuration register values. In my current setup Vref is 2.5V . If i measure 5v from ADC channel 0, i get 8388607 decimal and this value is correct (2^23 = 8388608) . when i connect ground to channel 0, i get 17543 decimal value from the read command. I think this value should be 0 decimal. am i correct??


    Thanks&Regards,
    Harsha B S
  • In reply to Harsha B S:

    Hi Harsha,

    I'm glad you were able to get the RREG and WREG commands working over the weekend!

    In response to your latest questions...

    Harsha B S
    1).How often do we need to do the synchronization process?

    Synchronization is only needed when you need to restart an ADC conversion (e.g. when multiplexing through multiple channels) or if you need conversions to begin at a fixed time (e.g. if you need multiple ADS1256's to sample voltage from multiple sensors simultaneously). Other than those use cases, you probably don't need to worry about synchronization.

    Harsha B S
    2).What is the difference between self calibration and system calibration? If we issue the SELFOCAL or SYSOCAL commands, the OFC registers are being updated. so which one do we need to perform? and how often do we need to do this calibration?

    The difference between "self" calibration and "system" calibration has to do with which errors you are trying to account for and remove...

    ...when performing "self" calibration you are removing the initial offset and gain errors of the ADC by itself. "System" calibration is used to remove the total offset and gain error of the system; resulting from the combination of errors coming from the sensor, signal conditioning circuitry, and ADC, for example.

    "Self" calibration is much easier to perform, because all you have to do is issue the self calibration command and the ADC will  internally measure it's own offset and gain error for you. "System" calibration requires that you provide the correct 0V and full-scale voltages externally. Often times system offset calibration is possible, but system gain error calibration is not, since it requires a very precise full-scale voltage.

    Which type of calibration you perform and how often you perform it is up to you... Whenever possible, I would recommend "system" calibration as it removes more errors than just the ADC errors alone. How often you calibrate will depend on how often you expect the offset and gain to change. If your system operates in an environment with a wide ambient temperature range, you might need to re-calibrate every so often to remove the offset and gain error dependence on temperature, or otherwise recall the calibration coefficients from a previous calibration performed at a similar temperature, for example.

    Harsha B S
    when i connect ground to channel 0, i get 17543 decimal value from the read command. I think this value should be 0 decimal. am i correct??

    In theory, yes.... A conversion result of "17543" corresponds to a voltage of ~10mV (for VREF = 2.5 and PGA = 1 V/V). Either the negative input channel is connected to -10mV, OR the ADC + any signal conditioning circuitry + the input signal source itself is contributing a offset error of 10 mV.

    You might try shoring the positive and negative inputs together (to 0V) to see how much of this error is coming from your signal source. Whatever error remains is the offset voltage, and you should be able to remove it through "system" offset calibration.

    Best regards,
    Chris


    Christopher Hall
    Applications Engineer | Precision Delta-Sigma Converters

    Check out our helpful resources:
    TI Precision Data Converters | TI Precision Labs - ADCs | Analog Engineer's Calculator | Data Converters Learning Center | Selection Guide

  • In reply to Christopher Hall:

    Hi Christopher,
    Thanks for the detailed explanation. It helped me a lot. while performing calibration and synchronization i got few more queries.

    I followed the below steps to read the multiple sensors connected to the ADC channels AIN0 to AIN3. Please confirm me whether my procedure is correct or not.
    > SRDATAC command (stop read data continuously)
    > select ADC channel (MUX register write)
    > perform synchronization (SYNC + WAKEUP commands)
    > read the data from the sensor
    > back to first step.
    1). Is it necessary to perform the synchronization every time i change the MUX register to select the ADC channel?


    I have followed these steps to perform the system offset and gain calibration.

    SYSTEM OFFSET CALIBRATION:
    I selected the single ended reading mode with positive input connected to ground and negative input connected to AINCOM (also connected to AGND). And then issued the SYSOCAL command.

    SYSTEM GAIN CALIBRATION:
    I selected the single ended reading mode with positive input connected to 5V and negative input connected to AINCOM (also connected to AGND). And then issued the SYSGCAL command.

    2). please confirm whether these calibration methods are correct. Do we need to follow this procedure for each and every channel??
    3). If i have the calibrated OFC and FSC values, can i use these values to directly write into these registers instead of re-calibrating again
    with ground and 5v?

    4). How does the buffer enable in the ADS1256 help us? what is effect of buffer on ADC reading when it is enabled?

    5). I need to know the procedure to detect the sensor connected to the channel for the first time and then start reading the sensor.
    Basically need to know how to handle the sensor detect current source to detect the sensors.


    Thanks&Regards,
    Harsha B S
  • In reply to Harsha B S:

    Hi Harsha,

    Your welcome! Regarding your multiplexing procedure, the sequence looks correct; just remember to wait for /DRDY to go low before repeating step 1. And regarding your additional questions...

    1) I'm not 100% sure if it is necessary, but issuing it will make the ADC switch channels faster.

    2) Yes, they look correct from what you've described.

    3) Yes, you can save the calibration coefficients and recall them again later. [6/20 UPDATE]: This is especially useful if you need to calibrate each channel separately.

    4) The buffer increases the ADC's input impedance. If your sensor does not have a low-output impedance, then the buffer may be necessary to prevent loading.

    5) To detect the presence of the sensor, you would follow a similar procedure as you have for multiplexing through the ADC channels, but for one (or more) of these channels you would enable the sensor detect current sources and measure the input voltage. If the voltage measurement is around ~5V or close to ~0V it can indicate that there is an open or short circuit, respectively.

    Please note, that when trying to measure the actual sensor voltage, you need to disable the sensor detect current sources to get the best measurement accuracy.

    I hope that helps,
    Chris


    Christopher Hall
    Applications Engineer | Precision Delta-Sigma Converters

    Check out our helpful resources:
    TI Precision Data Converters | TI Precision Labs - ADCs | Analog Engineer's Calculator | Data Converters Learning Center | Selection Guide

  • In reply to Christopher Hall:

    hi Christopher,

    Thanks for your reply.

    Today i tested with the sensor detect feature of ADS1256. I tested this by enabling the 0.5uA current source.
    While testing i selected single ended mode and tested with all the channels.

    when ADC channel is open , i read ADC value around 2161753 decimal.
    when ADC channel is shorted that means Psel and Nsel are shorted, i read 16772893 decimal. This is full scale value and enough to identify.

    Here, i can easily differentiate the 'short circuit' but 'open circuit' is little difficult is identify.
    This is because of the values are colliding when i connected the sensor which is providing the same voltage as that during the open circuit condition. Open circuit condition value is not zero. These are not same as you said "If the voltage measurement is around ~5V or close to ~0V it can indicate that there is an open or short circuit, respectively." but its inverted in my case. Please let me know anything is missing in our understanding.



    Thanks&Regards,
    Harsha B S
  • In reply to Harsha B S:

    Hi Harsha,

    I'm sorry, I was in a hurry to get you a reply yesterday and I was incorrect about the OPEN-CIRCUIT voltage...Because there is a 3V clamp that gets enabled, the open circuit voltage should be closer to 3V (not 5V, as I stated above).

    I did a quick test on the ADS1256EVM-PDK and for the OPEN-CIRCUIT voltage, with the 0.5 uA SDCS  enabled, I measure about 2.71 V when the inputs are floating, as shown below:

    In your OPEN-CIRCUIT case, you appear to be measuring a voltage of 1.28 V, is that correct? This would correspond to an effective impedance of about 2.5 MOhms connected to the inputs. Perhaps, with the sensor disconnected you still have this weak conductance path between the inputs? Do be sure to clean your PCB, if you haven't as solder flux residue can be responsible for this conductance.

    NOTE: If I increase the SDCS to 2 or 10 uA, then I measure a voltage slightly greater than 3V. You might also try increasing the SDCS currents to 2 or 10 uA to increase the measured voltage when the inputs are OPEN. However, do make sure that when your sensor is connected that you still measure a voltage well below 3V with these higher currents, so as not to mistake a connected sensor for an open-circuit.

    Best regards,
    Chris


    Christopher Hall
    Applications Engineer | Precision Delta-Sigma Converters

    Check out our helpful resources:
    TI Precision Data Converters | TI Precision Labs - ADCs | Analog Engineer's Calculator | Data Converters Learning Center | Selection Guide

  • In reply to Christopher Hall:

    Hi Christopher,

    I have used ADS1256 development board by wave share. In this board a RC circuit is connected to each ADC pin . RC circuit is having the values of 1kohm resistance and 0.1uF capacitance. The measured open circuit voltage seems to be approximately 640 millivolts . Its not around 3 Volts. I checked with the 2uA and 10uA current source also but its not around 3V. For 10uA we get around 4.4 volts and for 2uA we get around   2.4 Volts during open circuit condition.

    Theoretically we should read '0' ADC value when it is short circuited but i'm getting full scale ADC value as i mentioned yesterday. why this full scale voltage is been read by the ADC when it is short circuited ?

    In my application if i want to check for the sensor integration periodically then  how can i make sure that the sensor output voltage is within 3 Volts limit? I think its not possible to implement this feature practically with 5v analog sensors. Am i correct???

    Please find the details of measurements in the below table. 

    0.5uA SDCS

    2uA SDCS

    10uA SDCS

    ADC Value

    CRO Voltage

    ADC Value

    CRO Voltage

    ADC Value

    CRO Voltage

    Open Circuit

    1103365

    624mV

    4209867

    2.3V

    6966209

    4.4V

    Short Circuit

    16772508

    0V

    16775703

    0V

    15413

    0V

    Shorted with 33k Resistor

    32702

    24mV

    143194

    80mV

    731592

    400mV

    Thanks&Regards,

    Harsha B S

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.