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.

Differential output



hi sir I am using TM4C123G board I configured ADC0 SS3 in differential mode.I gave input (VINd = VIN+  - VIN-) as -1.3v the reading i got in putty terminal is 1197.If i configured as single ended i multiplied with 0.7326mV to get the given input.With what factor i would multiply with 1197 to get the given input

  • Hi Guntoju,

    I don't understand if you actually made a question. Could you elucidate me (and probably other forum users?)
  • Agree w/Luis - post could have been more carefully composed.

    Differential ADC mode demands that you confine the "differential" input voltage excursions to 1/2 the ADC's maximum input voltage - on both the "positive & negative" input voltage swings.    (i.e.± 1.65V for these MCUs when VRef is @/around 3V3.)

    Now when you input a differential voltage of 0V0 (that's 0.0V) the MCU will output 1/2 its full scale.   ADC readings exceeding that mid-scale result when the differential voltage drives positive - readings below mid-scale result when the differential voltage drives negative.

    Your post "weaves in" a multiplier factor which confuses rather than illuminates.   I'd avoid any multipliers - insure that you do NOT exceed the ADC's max rating and that indeed - the ADC differential readings behave as outlined, herein.   Only - and if/when - that success is achieved - would I add the complexity of, "scaling."

    KISS dictates one small step at a time - too much - too soon - over-challenges many!    (especially this reporter)

  • Hello Luis as per the specifications given in datasheet i configured ADC in differential mode.
    I gave (vin = vin+ - vin-)(vin+=0v,vin- = 1.5v) now vin<0 so the result range will be (0x000 - 0x800). When i see the reading in putty or the variable value it is 1100. My doubt is how to check the reading i got is same as i given at input.(If i configure ADC in single ended and i give same 1.5v i got output as 2048 . To get input what i gave i multiplied with 0.7326mv i.e 2048*0.7326=1500mv)So, similarly in differential how to check the output.
  • Poster cb1 AND Process "KISS" - both slowly, methodically raise pistols to their head...
  • Hello Anand,

    Did you check the meaning of differential Mode? And can you explain what is differential in the example you have?

    Regards
    Amit
  • HI Amit Sir,

    The voltage sampled in differential mode is the difference between the odd and even channels:

    ■ Input Positive Voltage: VIN+ = VIN_EVEN (even channel)
    ■ Input Negative Voltage: VIN- = VIN_ODD (odd channel)
    The input differential voltage is defined as: VIND = VIN+ - VIN-,

    Thanks and Regards

  • Hello Anand,

    OK and now what the connections are for Vref+, Vref-, VIN+ and VIN-. What is the expected ADC value and what is that you are reading!!!

    Regards
    Amit
  • Hi,

    Did you noticed this example:

    c:\ti\TivaWare_C_Series-2.1.1.71\examples\peripherals\adc\differential.c

    for differential ADC use? Please try it, check it and only if successful go further for scaling (should be the same as for single-ended...). This example is still present also in previous Tiva versions, find out yourself where it is.

    Petrei 

  • Let the record note the 3 "!!!" (note: I've "extra" bullets - and another gun...)
  • HI Amit Sir 

    I used internal refernce (From ADCCTRL register Vref+ = 3.3v,Vref- = 0v) and Vin+ = 2.0v and Vin- = 1.0v.

    I got reading as 2666 I multiplied with 1.611(mv Per ADCcode value) = 4294.How to know that ADC converted value is +1v.

    When i subtracted 3300mV from 4294mV i got 0.99 is this method correct?

    If  i  give  Vin+ = 1.0v,Vin- = 2.0v.Reading I got is 1430.(1430*1.611 = 2300) 2300-3300 =- 1000mV.

  • For some reason unit conversions always give people problems.

    First step is to change the conversion from an unsigned value with an offset to a signed value without an offset.

    SignVal = ADCVal - CENTRE_PT1;

    This should give you a signed value with 0 meaning zero volts differential and without the imprecisions introduced by floating point.

    For clarity I would then multiply by 2.  This should give you the same scaling as a single ended conversion.

    Check this and then we can talk about scaling if you have a question.

    This is essentially the same advice as Amit's.  Hopefully a change in wording helps.

    Out of curiosity, what are you using the differential mode rather than a differential op-amp configuration?

    Robert

    1 - This is the centre point of the A/D conversion range as explained in the processor manual.

  • Hello Anand,

    Note that 0x800 is the 0 volt differential code. The code you received is 2666 Dec which is 0xA6A Hex.

    Now if the code value received is greater than 0x800 then it is a positive voltage. Thus the sign is resolved as positive. The next thing to resolve it the amplitude. Thus the amplitude calculation becomes (0xA6A-0x800) * 1.611mV = 0.99V.

    If it were to be negative then (0x800-Value)* 1.611mV would give the amplitude and the fact that Value is < 0x800 would give the sign as -ve.

    Regards
    Amit
  • thank u amit sir i got solved my problem
    regards anand
  • Hello Anand,

    That is why the data sheet has a figure to explain the code v/s the differential voltage.

    Regards
    Amit