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.

Piccolo comparator hysteresis fed back to ADC?

Other Parts Discussed in Thread: TMS320F28027

Hi all,

in one of our Piccolo 28035 projects, a colleague observed that the ADC comparator, when active, influences the ADC result.

The result differs by the comparator hysteresis of approx. 35mV, dependent on comparator active or inactive.

This reduces the usability of the ADC channel in combination with the comparator (1% additional error).

 

Did others observe this, too?
Is this by design or is it a bug?
Or did my colleage measure wrong?

Thanks for your input,

Stephan

 

  • Stephan,

    The hysteresis is implemented using a Schmitt trigger and as such there is 100kOhm feedback resistor on the non-inverting input to the comparator.  If your input on the"A" channel has an input impedance close to this 100k, then it will be influenced based on the output state of the comparator.  If you turn off the comparator this will go away as you have noticed.  Does this correlate with your setup?

    Best,
    Matthew

  • Matthew,

    thanks for the response.

    We have checked this - there is a 1k input impedance at the A channel in our application. The B channel is fed by the comparator DAC.

    With 1k, we got ADC results that differ by approx. 32mV.

    We increased the input impedance to 2k and got results that differ by approx. 60mV.

    Our conclusion is that we can either have comparator hysteresis and a significant measurement error on the comparator A ADC input OR have no comparator hysteresis and no significant measurement error on the comparator A ADC input (when making the input impedance as small as possible).

    Where does the "typ. 35mV" comparator hysteresis value in the datasheet come from? It seems as if the hysteresis is very much dependent on the input impedance.

    Best,
    Stephan

  • Stephan,

    This is assuming ideal or <<small input impedance on this input.  You have 2 options with your system.

    1)Dynamically disable/turn off the comparator during ADC sampling, which may not be feasible depending on your ADC triggers

    2)Disable the hysteresis with the following:

    At address 0x714C Bits 1/6/13 control the COMP1/2/3 hysteresis enable.  Write a "1" to these bits to disable the hysteresis and as such remove the feedback resistor.  This register is EALLOW protected.  This should eliminate the voltage disturbance you are seeing.

    If your comparator threshold is fairly robust then this is it, but if you still want some noise filtering then use the digital qualification logic in the COMPCTL register for the respective comparator to act as digital "hysteresis"

    I will add these points to the UG/DS in the future. 

    Best,

    Matthew

     

  • Matthew,

    thanks for the answer and the info about the "hidden feature" to disable the hysteresis.

    My colleage will test it and has another question:

    The datasheet only states "35mV typ", no min or max value.

    Do min and max values for the 100k feedback resistor exist?

    Best,

    Stephan

  • The hysteresis disable works fine and helps us a lot, thanks!

    The only open point now is the tolerance of the feedback resistor.

  • Hello,

    how did you count the bits?

    I removed some measuring error by setting bit 12 (start counting by bit 0) for comparator 3. Is this right?

    Thomas

  • Thomas,

    I have mis-spoken for COMP3, it should be bit 11 the rest are OK

    I beleive this has been updated in the most recent version of the C header files that we release.  This structure is in the ADC.h and looks like this:

    struct COMPHYSTCTL_BITS{                // bits description
        Uint16  rsvd1:1;                 // 0    reserved
        Uint16  COMP1_HYST_DISABLE:1;      // 1    Comparator 1 Hysteresis Disable
        Uint16  rsvd2:4;                   // 5:2  reserved
        Uint16  COMP2_HYST_DISABLE:1;      // 6    Comparator 2 Hysteresis Disable
        Uint16  rsvd3:4;                   // 10:7 reserved
        Uint16  COMP3_HYST_DISABLE:1;      // 11   Comparator 3 Hysteresis Disable
        Uint16  rsvd4:4;                   // 15:12 reserved
    };

    Best,
    Matthew

  • Hi Mathew,

     

    Does this issue (Comparator feedback impedance) affect TMS320F28027 or any other 28xxx devices?

    Thank you.

     

    Keith

  • Keith,

    The 100kOhm feedback resistor is present in all C2000 devices with an internal comparator.  This is not an issue per se, but how we implemented the hysteresis in the comparator itself.

    Best,

    Matthew 

  • MatthewPate said:

    I beleive this has been updated in the most recent version of the C header files that we release.  This structure is in the ADC.h and looks like this:

    struct COMPHYSTCTL_BITS{                // bits description
        Uint16  rsvd1:1;                 // 0    reserved
        Uint16  COMP1_HYST_DISABLE:1;      // 1    Comparator 1 Hysteresis Disable
        Uint16  rsvd2:4;                   // 5:2  reserved
        Uint16  COMP2_HYST_DISABLE:1;      // 6    Comparator 2 Hysteresis Disable
        Uint16  rsvd3:4;                   // 10:7 reserved
        Uint16  COMP3_HYST_DISABLE:1;      // 11   Comparator 3 Hysteresis Disable
        Uint16  rsvd4:4;                   // 15:12 reserved
    };

     

    Note that this structure is available in v1.23 and higher of the 'F28035 header file package, but only V1.21 is available for direct download from ti.com here (http://focus.ti.com/docs/toolsw/folders/print/sprc892.html).  The newer versions seem to only be available through Control Suite.

  • Hi,

                 I am also facing same issue regarding Error of ADC result while using internal comparator of that particular ADC channel.

    Does disabling Hysterisis of comparator solved problem of ADC Error completely ?

    By disabling Hysterisis of comparator will it affect performance of Compartor ?

    In my application i am comparing voltage at ADC pin (COMPxA) with internal DAC and turn off PWM as well as measuring ADC voltage and display it.

    Thank You

  • Yes, disabling the hysteresis will make it so the voltage is not influenced by the comparator and there fore remove the error

    No, the comparator will function the same.  The only difference is that there will not be any analog hysteresis to prevent the comparator from ringing if the votlage is near the threshold.  There is a digitally implemented qual block on the output of the comparator that can be used in place of the hysteresis.

  • Dear matthew,
    I want to ask that if i don't want to disable the hysteresis resistor, can i use opamp (for low impedance) to drive ADC ?
  • Yes, an op-amp buffer with a low impedance output is a very good solution.