Post Go back to editing

AD7997 inconsistent conversion results, front end filter assistance

I'm working on a design that includes the AD7997, the ADCMP393 and the TI LM2902 and am seeing inconsistent and inaccurate voltage reads from the AD7997.  I am trying to determine how to rectify this and produce stable and accurate reads from the AD7997.  Schematic included in which I've included a red box around an RC filter that I believe may be required but I am looking for confirmation on whether or not this is the right approach and, if so, what values I should be using for Rext and Cext and if this is not the right approach what approach should I be taking.

The 3V VREF for the AD7997 comes from the ADR06.  The 12V source for the circuit is sourced from a 12V voltage regulator which in my prototype comes from the ROHM BAJ2DD0T which is a LDO (1%) linear regulator.  I've measured the frequencies on 4 identical circuits and see that as ~55kHZ.

In operations this circuit will work as;

1. MCU software uses AD7997 to read voltage when switch is open (Vopen) and separately when switch is closed (Vclosed).  I have these reads coded both as a single read and a series of sequential reads that are averaged which I'm doing to determine if that is needed to produce a more accurate representation of voltage while i'm in development mode.

2. MCU software uses Vopen and Vclosed to determine the tap setting for the potentiometer (here I am using the AD5144A) to a value that produces a reference voltage for the ADCMP393 that is between Vopen and Vclosed

3. MCU software sets the tap

4. when state of switch changes between open/closed this triggers the ADCMP393 out to flip between high/low which signals MCU software

5. MCU software uses AD7997 to read voltage on circuit.  I have these reads coded both as a single read and a series of sequential reads that are averaged which I'm doing to determine if that is needed to produce a more accurate representation of voltage while i'm in development mode.

In development mode I am also sampling these reads outside the scope of switch state changes just to measure what the AD7997 is reading.

Add Tags
[edited by: @skowalik at 3:54 PM (GMT 0) on 21 Nov 2019]

    Just want to clarify that I understand the operation of your circuit correctly with respect to the timing.

    • When you say that the frequency (of the switching??) is 55KHZ is it safe to assume that the converter is running at approximately 2x that rate or 110KHZ?

    To help clarify the problem could you please provide information regarding the following:

    1. Can you share a bit more about how you are configuring the AD7997?
    2. Would it be possible to share scope captures of the switching operation versus the data communications?

    At first glance I think that adding an RC network such as you've drawn could potentially help, however, I would move the input of the ADCMP393 before the filter.    In this way any charge kickback from the data converter itself won't cause any false triggering of the comparator due to charge kickback.   As a rough guess I would start with 10 ohms and 2.7nF (6 MHZish BW).   If you want to be more precise with your selection you can follow the enclosed link to an an article that will guide you to an optimized solution.


  • Hi Sean,

    I measured the frequency using my Amprobe 37XR-A though I am questioning what I measured there as I'm not sure if measuring frequency is something only possible on AC circuits, it is possible that I had it mis-configured and thought I was reading frequency.  It seemed to be but it is possible I was doing this incorrectly.   Using the schematic I provided as a reference I had one probe on the high side of R3 and the other probe where I drew the RC filter, was trying to read these again last night and couldn't replicate the readings.

    When you say how I am configuring the AD7997 I assume you're asking about what mode i am operating it in etc, if it is something else please let me know.  I am operating it in Mode 2, below are the fundamental elements of the relevant code primitives that set the conversion (ie: setConversion()) and read the conversion results (ie: readConversion()).  getConversion() wraps some controlling logic around those primitives to handle failures in the set and the read as well as reads that return data for a channel different that that which was requested.  It isn't shown here but I have logic in my I2C subsystem that controls ownership of the I2C bus though I need to add to that so that when a conversion is taking place (ie: start with set, end with read) the I2C bus is held quiet.

    def setConversion(I2CBus, I2CAddress, ADCChannel):
    return i2c.write8(I2CBus, I2CAddress, (112 + (ADCChannel * 16)), 0)

    def readConversion(I2CBus, I2CAddress):
    return i2c.readU16(I2CBus, I2CAddress, ADC_APR_CONVERSION_RESULT_REGISTER)

    def getConversion(I2CBus, I2CAddress, ADCChannel):
    i = 0
    resultChannel = 0
    while ((i < ADC_LOOP_COUNT) and (resultChannel != ADCChannel)):
    i = i + 1
    result = setConversion(I2CBus, I2CAddress, ADCChannel)
    if (result != -1):
    result = readConversion(I2CBus, I2CAddress)
    if (result != -1):
    swap = int(format(result, '016b')[8:16] + format(result, '016b')[0:8], 2)
    resultChannel = extractChannel(swap)
    resultChannel = -1
    if (resultChannel == ADCChannel):
    return swap
    return -1

    Unfortunately I do not have an oscilloscope and I can't take readings though if I must i'll go buy one.  Believe the Amprove 37XR-A can do some but i'm a SW engineer, not an EE/HW engineer.

    Regarding the article I do have that and I've worked through the math though I am questioning what my output is.  According to my math if i'm at 2.7nF on the external capacitor I should be using a ~7500 ohm external resistor.  I've built this and it did improve things but I am off by about 5% on the high side when 12V is flowing but when 0V is flowing I am still reading about 600mV per the ADC.

    When you say move the CMP393 ahead of the filter am I able to do that simply by placing the tap to the CP393 physically before the RC filter or do I need to separate the CMP393 and the RC filter with something?

    Greatly appreciate the input and feedback, hoping to identify a solution soon so I can keep moving forward.  Is it possible I should move off the ADR06 as the VREF to the AD780 or the ADR423?  Both are listed with the AD7997/AD7998 as recommendations for VREF and the AD780 is what is included in the eval board.  Just curious if either may help improve things.

    thx - sean

  • Hi Sean - FYI, regarding the formulas etc from the "Front-End Amplifier and RC Filter Design for a Precision SAR Analog-to-Digital Converter" document you pointed me to see the attached spreadsheet in which I worked through them so that I could better check my math.  You'll see a set of fields shaded in green for inputting the values for a circuit under design and in the column to the right you'll see the example used in that document.  Not sure if it can be of help to others and it could be cleaned up a bit but it does calculate correctly.

    thx - sean


  • Sean,

    1) Your computed value for R is too large for your application. as the corner is at approximately 7.8KHz which is less than your conversion rate.   Additionally the converter is going to go to sleep between conversion requests and thus your acquisition time is limited to the power-up and settle time of 1us.  Thus you are going to want to allow for your forward settling to 1/2LSB at 10 bits to occur in the 1us allotted which puts your time constant at around 130ns puts your R at around 7 ohms.

    2) For the 0V reading I can't explain why you have such a large non-zero output code but I would expect (based on the specs) that you would expect a few 10's of mV due to the offset of the amplifier and the fact that the output range is limited given your single supply operation.   It may be that incomplete settling of the ADC input explains the rest.   Let's see what you get when you modify the filter.

    3) My suggestion on the comparator input is to move the input to the amplifier output such that any disturbance from the ADC waking up and taking a sample does not inadvertently trigger the comparator.

    4) I'm not sure you need to change the reference at this stage.   Let's see what we get if you change the value of R and go from there.