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.

Touch screen ADC differential mode

Hi,
I need some clarifications about TSC_ADC_SS differential mode.
Unfortunately, this mode does not described in details in Ch. 12 of Technical Reference Manual.
I didn't find differential mode usage in Starter Ware examples too.
(adcVoltMeasure example for EVM and EVMSK demonstrates single ended operational mode).

I tested TSC ADC in single ended operational mode, external references, successfully.
My settings:
STEPCONFIG: 0x1BC3004
SEL_INP: Channel 8 (AIN7)
SEL_RFP: VREFP
SEL_RFM: VREFN
SEL_INM: VREFN
16 samples average.
SW enabled, one-shot.

As result, I read ADC code 2000 (approx.) for voltage 880 mV that correspond conversion formula.

But when I set differential mode (STEPCONFIG = 0x3BC3004) I read ADC code approx. 3000.
Is it right?
What is reason of offset?
What is conversion formula for this case?

Best Regards,
Oleg.

  • Hi Oleg,

    What software do you use?

  • Also, is this a custom board? If it is, what are VREFP and VREFN voltages?
  • Hi, Biser.

    I use Beagle Bone White. So, VREFP = VDDA_ADC = 1.8 V, VREFN = VSSA_ADC = GNDA_ADC = 0 V.

    I tested ADC under Linux from TI SDK PSP-04.06.00.07 (kernel 3.2.0).
    I modified register settings in file "drivers/input/touchscreen/ti_tscadc.c".
    And I defined .mode = TI_TSCADC_GENMODE in struct "am335x_touchscreen_data" in file "arch/arm/mach-omap2/board-am335xevm.c" for general-purpose ADC mode (I don't need touch screen support).

    But my result for Differential mode is not depend on Reference.
    Original settings of this driver was: STEPCONFIG = 0x380004 (Internal Ref). And I got approx. 2000 code.
    When I set only Diff. bit 25, i.e. STEPCONFIG = 0x2380004, then I got approx. 3000 code with offset.
    Why?

    Best Regards,
    Oleg.
  • I have asked the ADC experts to comment on this.
  • Ok, thank you.

    I tried to find detailed explanation in Ch.11 of TRM am437x that contains same TSC_ADC_SS, but didn't find more information.
    Probably my question concerned to TSC_ADC_SS architecture. And Fig. 12-2 is not complete for diff.mode.

    Best Regards,
    Oleg.
  • The ADC output is positive binary weighted data ranging from 0 to (2E12 - 1). When configured for single-ended mode, ADC output data values 0 to (2E12 - 1) represents a corresponding input voltage that ranges from the ADC negative reference (REFM) voltage to the ADC positive reference (REFP) voltage. When configured for differential mode, ADC output data values 0 to ((2E12/2) - 1) represents a corresponding negative differential input voltage that ranges from the ADC REFP voltage to the ADC REFM voltage and output data values (2E12/2) to (2E12 - 1) represents a corresponding positive differential input voltage that ranges from the ADC REFM voltage to the ADC REFP voltage.

    In differential mode, zero volts should produce a half-scale value of 2048. So you your 880mv input will provide a value about half way between the half-scale value and full-scale value of 4095.  I would estimate a value of about 3049.

    Regards,
    Paul

  • Hi, Paul

    I understood you clear. Thank you for detailed explanation.

    I have one more question about ADC_IBIAS and BIAS_SEL signals on Fig 12-2 (TRM am335x).
    Is BIAS_SEL signal correspond to bit "ADC_Bias_Select" in CTRL reg? As written in TRM, value 1 is "Reserved".
    What is function of this bit? Is it link to differential mode?
    So can I subtract diff. mode offset in hardware? Or I should do it in my software?

    Best Regards,
    Oleg.
  • You are correct the ADC_BIAS_SELECT controls a 2:1 analog multiplexer that select the BIAS source. As shown in the AFE Block Diagram, the external bias input to the block is a no-connect. So you would not want to select this input. This why the value of 1 is reserved.

    The only way to change the scale is to use single-ended mode. Why are you trying to use differential mode to measure a single-ended signal? You are throwing away half of your dynamic range/resolution if only applying a single-ended positive voltage relative to VREFN.

    Regards,
    Paul
  • I thought to reduce signal interference (noise) due to differential mode. I watch instability 4 LSBs in 12 bits full scale in single-ended mode. But now I understand that I will not get advantage because twice decreasing ADC scale in diff.mode.

    Best Regards,
    Oleg.
  • Hi, Paul and Biser

    Thank you very much for your help.
    I suppose your detailed explanation about differential mode would be nice to add a TRM for am335x and am437x.

    Best Regards,
    Oleg.