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.

ADC issues with TM4C1231H6PZ

Hi,

I am using ADC0 with sequence number 3 (single sample) and an external 3V reference.  I am sampling on over a dozen channels, most of which return reasonable values.  However, there are some that consistently return incorrect values (as compared to the actual voltage going into that channels, as verified with a volt meter).  Some of the values are low and some are high.  What could cause some channels to give inaccuracies?  

Thanks!  Cindy

  • The list is nearly endless.

    Describe your setup and what you mean by inaccuracies. IE how far off is the result etc...

    Robert
  • Cynthia Crutchfield said:
    Some of the values are low and some are high.

    Even w/out knowing of your set-up I'd bet that (often) those "unexpected" values occur when there is a, "significant difference in voltage" between successively read, ADC channels.  

    Past posts here - by poster Robert & myself - further detail the, "Care & Handling" of signals "prior" to presentation to the MCU.

    You must realize that ADC's built into MCUs (mixed signal devices) are not "famed" as exacting in their measurement accuracy.   (and devices, "designed to just that ADC purpose" flood this vendor - and other's - sites & catalogs...)

  • Hi Robert-

    Here are the basics:

    ADCReferenceSet(ADC0_BASE,ADC_REF_EXT_3V);
    ADCSequenceDisable(ADC0_BASE,3);
    ADCSequenceConfigure(ADC0_BASE,3,ADC_TRIGGER_PROCESSOR,0);
    ADCIntClear(ADC0_BASE, 3);
    ADCSequenceEnable(ADC0_BASE,3);
    ...

    For each sample I do the following, where "channel" is the channel I'm sampling:

    ADCSequenceStepConfigure(ADC0_BASE, 3, 0, channel |ADC_CTL_IE |ADC_CTL_END);
    ADCSequenceEnable(ADC0_BASE,3);
    ADCProcessorTrigger(ADC0_BASE,3);
    while(!ADCIntStatus(ADC0_BASE,3,false) ){}
    ADCIntClear(ADC0_BASE, 3);
    samplesize=ADCSequenceDataGet(ADC0_BASE, 3, sample);

    My results are not off wildly. Here are some typical errors (should be/sample returned):
    2.5/2.9934
    1.8/1.4280
    1.35/1.1788
    1.2/0.8285

    The errors I get are always on the same subset of channels, with the other channels giving
    accurate results. And there isn't a large disparity between the voltages on the adjacent
    channels. Thanks for your help!

    Cindy
  • Hello Cynthia

    Please share the initialization and the software configuration to do so? If you only use the "inconsistent" channels one at a time then does the issue occur?

    Regards
    Amit
  • Hello Cindy,

    What if you repeatedly sample the same channel then does it stabilize. What is the Source resistance as being seen by the channels in question?

    What is the state of channel AIN0? If you connect it to a 3.3V source then does it affect the reading. There is a known errata for ADC Channel AIN0 (if you may want to look it up).

    Regards
    Amit
  • Cynthia Crutchfield said:
    And there isn't a large disparity between the voltages on the adjacent   channels.

    Pardon but, "Devil in the details."    It is not "adjacent" channels but those read in, "quick succession!"    The ADC's single sampling cap must be properly treated (via external circuitry) - and its "visit" timed so as to minimize, "successive channel bleed or cross-talk."

  • What sensors?
    What signal conditioning

    Robert
  • Robert Adsett said:
    What sensors?
    What signal conditioning?  

    May we ask - exactly - that question of you, Robert?    (might you have stood - bit "too closely" - to those "Dominion Day" explosives?

    This reporter - after two thread re-reads - finds zero mention of, "sensors or signal conditioning." 

    While both sensors & their "conditioning" are normally encountered with ADCs - neither has (yet) landed - this "hiccupping ADC" space...

  • Hi Amit,

    Repeated readings do not change over time. Changing the order in which the channels are read does not affect
    the readings. I just asked the hardware engineer about the source resistance. One of the channels of issue has
    430 ohms resistor with 4.7uf to GND. All the other channels have a voltage divider, 698 ohms and 499 ohms with
    4.7uf to GND. I hope I explained that correctly. We can't changed to a a 3.3V source without a board modification,
    so I can't tell you what that would do to our readings.

    I'm having trouble with AIN16, AIN17, AIN18, and AIN20 and AIN21. AIN0 is fine.

    Thanks, Cindy
  • I get the same results when I step through the code, so I don't think timing/channel bleed/cross-talk is an issue...
  • Cynthia Crutchfield said:
    I get the same results when I step through the code, so I don't think timing/channel bleed/cross-talk is an issue...

    Now that's rather convincing - and confounding.   (and destroys my (not too) SWAG!)

    Might you switch those "high order channels" to the 2nd ADC instantiation w/in your MCU - and repeat your tests?

    Also - and always - beware dreaded, "Single Board Anomaly!"    Repeat this test procedure - duplicating as much as possible - on a 2nd and/or 3rd board.  (Hours/days can be "misspent" chasing a, "One Off" issue - that's way wasteful...)

  • Hi! I tried ADC1 with the same results. We currently have 5 boards going and all are presenting with the same problem.
  • Hello Cynthia,

    Thanks for the confirmation on the issue. Now can you connect a scope probe on the input pin, toggle a GPIO before triggering the ADC conversion and capture the ADC pin with a GPIO Pin as trigger on the scope. This should show what is happening on the input side of ADC.

    Regards
    Amit
  • Thanks Amit. I'll do this after the holiday weekend and get back to you. Thank you so much for all your help!

    Cindy
  • Amit Ashara said:
    This should show what is happening on the input side of ADC.  

    Indeed it may - yet that still shifts (likely) blame to poster's handling of that, "input side of (the) ADC."    It's not proven (yet) that "incorrect handling" is the case!

    Would not simple logic trump GPIO code write & scope measures?    (and - how accurate may that scope measure be - especially if the signal level is w/in the upper third of the ADC's max input voltage?)

    Instead - why not - more simply - "exchange" several of those "suspect ADC channels" with those, "thought good?"     Then - if the problem "moves/continues" with the "suspect channel" - it's reasonably certain that the external signal handling is faulty.   But - if the "suspect channel" now measures to your liking - blame lands (squarely) upon the MCU - or some set-up/config.  

    One more observation from this (unthanked) reporter - are not "all" of these "suspect channels" both "clustered & high numbered" w/in this MCU?   Might your pcb routing - and/or introduction of these ADC signals to the MCU - come "too close to" current carrying or high frequency, digital signals?   The ADC signal "swap" - suggested above - may highlight this potential issue.

    With facts - thus far in evidence - my "chips" pile high on MCU and/or imperfect set-up as the culprit...   "Swap" is - by far - your best/easiest means to test/verify.

  • Cynthia Crutchfield said:
    I get the same results when I step through the code, so I don't think timing/channel bleed/cross-talk is an issue...

    That seems an optimistic assessment to me.  It assumes that the A/D front end is using a track and hold rather than a sample and hold.  I don't remember it being documented either way. 

    Robert

  • There is always a sensor, otherwise no need for an input, even if the sensor is just a power supply. There is always signal conditioning, even if it is only a wire.

    Robert
  • Also verify the reference.

    A good check at this point would be to convert only a single problematic channel and see if you have the same issue.

    Other items to check

    • High frequency on the line, I have seen high frequency spikes glitch an A/D.
    • You mentioned an external reference, check that it has sufficiently low impedance.
    • Check that your signal reference is not drifting from the analog ground on the micro.

    Robert

  • Cynthia Crutchfield said:
    ne of the channels of issue has
    430 ohms resistor with 4.7uf to GND

    I would expect that to be sufficient provided that the capacitor is on the CPU side and is a good ceramic or film cap.

    However, the source impedance will add to that. Also if that RC is being fed from an op-amp you need to verify that 430 Ohms is sufficient to stabilize it (Seems likely but it should still be verified at least experimentally)

    Note DMMs provide only very rough comparisons here, they will filter most noise, only presenting the DC component.  You need to check with an oscilloscope.

    Robert

  • The simple "swap" of "suspect channel's signal" with "good channel's signal" - as detailed here earlier today - reveals so much - yet has (yet) to receive your "second."
  • I agree that the swapping of inputs would be helpful information- this would require a board mod, and I'll speak to the HW engineer about it. Thanks!
  • Hi Robert,

    If you mean do nothing but set up the ADC and convert one problematic channel and look at the results, I have done that with the same error being present. Thank you for all of the above suggestions. I'll share this with my HW engineer and we'll run some test. Monitoring the voltages is critical, so we'll be at this problem until it gets solved. Thanks for all your help. Cindy
  • Cynthia Crutchfield said:

    If you mean do nothing but set up the ADC and convert one problematic channel and look at the results, I have done that with the same error being present.

    That's what I'm referring to. That eliminates simple crosstalk between sampling inputs being an issue. cb1's swap test eliminates A/D setup but I don't think that's your issue.

    It is essential you get an oscilloscope on your signal. to compare with what you are converting. With a 2mS filter, a DMM is definitely not sufficient.

    If you have to wait for an oscilloscope, and especially given you see values both above and below your expected value, you could grab a series of samples at a sample rate of at least 1kHz and display them.  You should get at least 500 or 1000 samples at that rate (i.e. 1/2 second or longer) and observe the result.  Graph it, calculate mean, std. Dev, min and max. The results may be illuminating even without a 'scope.

    Robert

  • Hi Robert,

    The HW investigation portion of the problem will probably be delayed a week due to other issues we have to deal with this week, but I will try your suggestion of gathering a series of samples and examining the results if a get a free minute this week. I'll get back to you when I have more information. Thank you so much for all your help!

    Cindy
  • Prior to this thread entering, "deep sleep" these 2 observations may have merit:

    a) Are the bulk (even better all) of the "offending" ADC channels confined to "one side" of your 4-sided MCU?   Having past worked @ similar, semi-giant - we noted a similar issue - which inflicted itself upon, "one specific side" of the MCU.    As we dug deeper - it was determined that the (internal) analog power rail "insufficiently serviced" that side of the device.   Upon that discovery - issue was addressed & fixed.    Now it may also prove true that your treatment of the critical power pins - appearing on that same chip side - is "borderline" or even outside, MCU spec.   (and our firm has seen just that - cap values/placement along w/VddA & VssA routings/thickness are critical - your design & board implementation must give the MCU, "Every chance to Succeed!")

    b) My small tech firm now (most always) tests/evals each new candidate MCU's ADC by injecting a signal from a properly conditioned, 2V5 voltage reference.   We "steer" this signal thru a very proper (resistance extremely low & equal among channels) analog mux IC - to each/every ADC pin - and then log the ADC results over time/temperature.   It is this "consistency of analog signal presentation" which I am providing as the best means to implement the earlier, suggested, ADC channel swap.    That (same) stable signal - injected in a very consistent (& short/direct) manner - into each ADC channel - appears to qualify as a very effective ADC test...

  • Hello Cindy

    Any update on the scope plots.

    My friend cb1 suspects "deep sleep", but I suspect this is an interesting thread to "not" deep sleep.

    Regards
    Amit
  • Cynthia Crutchfield said:
    The HW investigation portion of the problem will probably be delayed a week due to other issues

    Hi Amit,

    Just like you - we are disappointed to be, "cast-off" when (potentially) so close to (maybe) issue resolution.    As my latest post notes - injection of a known good, properly conditioned, stable output signal into first a, "Passing" ADC channel and then into a "Failing" one seems near ideal.

    I'd especially like to know if the bulk of those "failing" ADC channels mostly reside upon one side of the MCU.   Should that prove true - I'd put down some cb1 cash (rare that) on client's improper handling of that chip's power management - particularly upon that side of the chip.

    As usual Amit - you stand atop the mount as, "best ever" Forum Guide - and BY FAR!

    Thank you, my friend...

  • Hi Amit,

    Our boards are tied up this week with integration of other parts of hardware.  This week will be a little nap maybe, but this problem will never become deep sleep!  I'll try to get my hands on a board ASAP.  Thanks for keeping track of this.  I'll be back with more info ASAP!

    Cindy  :)

  • Cynthia Crutchfield said:
    Our boards are tied up this week with integration of other parts of hardware.

    Yet - if my suspicion regarding component quality/placement/routing - proves correct - any new, "integration of other parts of hardware" may be impacted!

    It is unusual to receive so wide, consistent & in-depth tech analysis - and at a (very) reasonable rate!    To place this support @ "Back of the bus" in favor of, "other parts" - seems not especially well advised.  (you'll always have your "captive" staff - not so much those remote helpers - here, NOW!...)

  • Hello Cindy,

    I think a preliminary work on a "non integrated" hardware would be advisable before compounding of issues begin.

    Regards
    Amit
  • I agree and so appreciate all the help! I'll return to this problem the minute I can get my hands on a free board, believe me!
  • Hey,

    We have an external vendor/subcontractor who is with us for only this week, so we need to do the best we can.  I'm not the master of my own domain lol!

    Cindy

  • Cynthia Crutchfield said:
    I'm not the master of my own domain

    While a (bit) "inside USA television" humor - neither were (if memory serves) George, Jerry, & Elaine.

    Of all the possible reasons to, "Kick us to the curb" (thank you Ke$ha) yours (almost) proves justifiable...

  • Hi Amit,

    I'm back from my other work and have had some time to address the ADC issue.  So, the HW engineer read through the posts and we looked at the ADC inputs during conversion.  We noted no noise of significance.  Meanwhile, I ran the test you asked for- gathering 1000 samples on the problematic lines and looking statistically at the output.  Here is a representative sample.  The data seems to be pretty uniform.  This is the data returned directly from the ADC on one of the problematic channels.  Thanks again for all your help.

    Cindy

    Result

     

    Sample Standard Deviation, s:            0.70132079025996

     

    Sample Standard Variance, s2            0.49185085085086

     

    Total Numbers, N            1000

     

    Sum:            2265629

     

    Mean (Average):            2265.629

     

    Population Standard Deviation, σ            0.70097004215587

     

    Population Standard Variance, σ2            0.49135900000001

     

     

     

    If it follows the normal distribution

     

    The 68.3% measure confidence range, σ            2264.9276792097 - 2266.3303207903

     

    The 90% measure confidence range, 1.645σ            2264.4753273 - 2266.7826727

     

    The 95% measure confidence range, 1.960σ            2264.2544112511 - 2267.0035887489

     

    The 99% measure confidence range, 2.576σ            2263.8223976443 - 2267.4356023557

     

    The 99.9% measure confidence range, 3.291σ            2263.3209532793 - 2267.9370467207

     

    The 99.99% measure confidence range, 3.891σ            2262.9001608051 - 2268.3578391949

     

    The 99.999% measure confidence range, 4.417σ            2262.5312660694 - 2268.7267339306

     

    The 99.9999% measure confidence range, 4.892σ            2262.198138694 - 2269.059861306

  • Hello Cynthia

    And the expected value on the pin is?

    Regards
    Amit
  • Thanks,

    A few comments and suggestions

    • You mentioned earlier that you see values above and below the expected.  I don't see that here.  In fact this data looks rock steady.
    • What frequency are you gathering the data at?
    • You really should be platting the raw data, not just the stats.
    • One of the pieces of information you can get is an eyeball look at the distribution if you simply plot a histogram.
    • What are the min/max?

    Robert

  • Hi Amit,

    Sorry for the very long delay in my response.  The boards were out of commission for a bit.  The last bit of data I gave you was actually for one of our good readings- that is 3.3 volts and is reading at 3.31- so it's actually OK.  Here are the stats for some of the problem rails:

    Channel 17, ADC=~ 2330 with NO variation, yields voltage=1.42    Should read 2951/1.8volts

    Channel 18 ADC=~1787 with a lot of variation at the beginning, then settling.  Should read 2213/1.35volts

    Channel 20 ADC=~2627 with a lot of variation (2619-2638) throughout.  Should read 1967/1.2volts

    Channel 21 ADC=~2053 with little variation (a few 2054's).  Should read 1708/2.5volts

    The voltage rails of 2.5 and greater have different voltage dividers than the smaller voltages, which is why Channel 21 looks different than the others I've included, as far as the relative ADC codes are concerned.  Below are some snippets of the data.  I'm not including Channel 17 because there was no variation.  I can run statistics on them if you'd like.

    To gather the data I sample a single sample at a time using Sequence 3.  I gather 100 samples at a time and then wait a few milliseconds and then repeat the process multiple times (usually).  I then take an average of all those ADC codes to yield the code I use to convert to volts.

    Thanks so much!

    Cindy

    Channel 18

    1571, 1793, 1918, 1923, 1859, 1827, 1814, 1806, 1800, 1796, 1793, 1792, 1792, 1790, 1790, 1789, 1789, 1789, 1789, 1790, 1789, 1790, 1790, 1790, 1790, 1789, 1789, 1790, 1790, 1789, 1789, 1788, 1788, 1787, 1787, 1788, 1788, 1788, 1787, 1788, 1787, 1787, 1787, 1788, 1788, 1788, 1788, 1787, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1787, 1788, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1790, 1789, 1789, 1790, 1790, 1790, 1789, 1790, 1789, 1789, 1790, 1789, 1790, 1789, 1789, 1789, 1789, 1789, 1789, 1790, 1790, 1789, 1789, 1789, 1789, 1790, 1789, 1790, 1790, 1790, 1789, 1789, 1789, 1790, 1790, 1790, 1789, 1790, 1790, 1789, 1789, 1790, 1789, 1789, 1789, 1790, 1789, 1789, 1789, 1789, 1789, 1789, 1790, 1789, 1790, 1789, 1789, 1788, 1787, 1786, 1787, 1788, 1788, 1787, 1788, 1788, 1787, 1787, 1788, 1787, 1787, 1788, 1789, 1789, 1789, 1789, 1789, 1790, 1789, 1790, 1789, 1790, 1789, 1790, 1790, 1789, 1789, 1790, 1789, 1789, 1789, 1790, 1790, 1790, 1789, 1790, 1790, 1790, 1789, 1790, 1790, 1789, 1789, 1790, 1789, 1789, 1790, 1789, 1789, 1788, 1788, 1787, 1788, 1787, 1787, 1787, 1787, 1787, 1788, 1788, 1788, 1788, 1787, 1787, 1788, 1788, 1788, 1787, 1787, 1788, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1788, 1787, 1787, 1787, 1787, 1787, 1788, 1788, 1787, 1787, 1787, 1788, 1787, 1787, 1787, 1788, 1788, 1787, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1787, 1787, 1788, 1788, 1787, 1789, 1788, 1788, 1787, 1787, 1788

     

    Channel 20

    2627, 2634, 2628, 2623, 2632, 2632, 2627, 2632, 2627, 2625, 2630, 2624, 2624, 2623, 2622, 2630, 2625, 2630, 2624, 2626, 2624, 2622, 2626, 2625, 2625, 2631, 2632, 2630, 2629, 2632, 2623, 2633, 2625, 2625, 2623, 2633, 2630, 2627, 2623, 2621, 2632, 2632, 2625, 2633, 2629, 2633, 2622, 2624, 2631, 2628, 2628, 2628, 2371, 2628, 2625, 2626, 2629, 2626, 2630, 2628, 2624, 2632, 2630, 2626, 2628, 2622, 2624, 2628, 2626, 2627, 2628, 2632, 2631, 2625, 2623, 2624, 2629, 2631, 2628, 2626, 2631, 2632, 2628, 2624, 2633, 2631, 2628, 2627, 2628, 2626, 2627, 2624, 2627, 2629, 2626, 2629, 2626, 2627, 2626, 2632, 2624, 2626, 2373, 2626, 2623, 2628, 2631, 2628, 2630, 2628, 2629, 2633, 2624, 2375, 2631, 2629, 2625, 2625, 2628, 2630, 2630, 2624, 2625, 2624, 2624, 2624, 2627, 2630, 2626, 2629, 2627, 2630, 2626, 2628, 2627, 2631, 2623, 2623, 2623, 2627, 2628, 2627, 2627, 2632, 2625, 2630, 2621, 2633, 2626, 2620, 2629, 2626, 2630, 2627, 2625, 2629, 2631, 2633, 2627, 2632, 2624, 2628, 2629, 2625, 2626, 2374, 2626, 2624, 2628, 2626, 2630, 2364, 2629, 2633, 2632, 2628, 2628, 2625, 2624, 2628, 2628, 2631, 2622, 2630, 2630, 2633, 2630, 2623, 2626, 2097, 2629, 2620, 2628, 2632, 2628, 2624, 2622, 2628, 2619, 2373, 2632, 2630, 2372, 2632, 2622, 2624, 2623, 2630, 2632, 2629, 2628, 2624, 2628, 2626, 2624, 2630, 2631, 2628, 2626, 2624, 2631, 2621, 2630, 2624, 2631, 2624, 2631, 2627, 2630, 2370, 2625, 2372, 2629, 2628, 2372, 2627, 2631, 2631, 2625, 2631, 2627, 2626, 2624, 2635, 2624, 2624, 2630, 2628, 2629, 2629, 2627, 2628, 2631, 2622, 2629, 2367, 2632, 2627, 2627, 2634, 2630, 2624, 2630, 2634, 2625, 2628, 2624, 2630, 2629, 2628, 2634, 2626

     

    Channel 21

    2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053

  • Hi Robert,

    Thanks for your interest and help- please see my last response to Amit for more information/data.

    When I said I get values above and below what I expect, I mean that at times the ADC codes I get will reflect a voltage that is higher than I would expect, and sometimes they reflect a lower voltage than I would expect. Sometimes the data is rock solid, and sometimes it is a little erratic, as you can see from my post to Amit.

    It's tough to determine the actual frequency of my collection, since I am gathering a single sample at a time. The system clock is 80MHz.

    I've included the min/max in my reply to Amit, and a sample of data for some of the channels. Let me know if you still think histograms would be helpful and I'll try to generate them.

    Thank you! Cindy
  • 2619-2638 is not a lot of variation. It's very nearly rock steady.

    Robert

    Btw what are you usung for a reference?
  • You need to get a handle on your sample rate. And you need to plot you data vs. Time.

    You have an embarrassment of timers available to use.

    Robert
  • Why do you say should read? How are you verifying the input to the a/d?

    Robert
  • Cynthia Crutchfield said:
    However, there are some that consistently return incorrect values

    That from her very first post - yet few (No) facts in evidence (yet) suport that claim.

    We know - long ago - "Peter" cried "Wolf."   The inconsistency between initial post & data dump deserves some explanation...

  • Cynthia Crutchfield said:
    When I said I get values above and below what I expect, I mean that at times the ADC codes I get will reflect a voltage that is higher than I would expect, and sometimes they reflect a lower voltage than I would expect.  Sometimes the data is rock solid, and sometimes it is a little erratic, as you can see from my post to Amit.

    And so far your data doesn't reflect that.

    Robert

  • Hi Robert,

    I should have given you all of the expected voltages- these are the values that are read at the input pin to the ADC, with the first column holding the expected values and the second the values the ADC is giving me:
    AIN17: 1.8 volts ADC=1.42volts
    AIN18: 1.35 volts 1.18volts
    AIN20: 1.2 volts 1.63volts
    AIN21: 2.5 volts 3.01volts

    So my data does support that at times my readings are low and at times high. I'm looking at the inputs to the ADC's at the input pins, with a scope, to determine the expected values.

    I should point out that I'm using 19 channels on the ADC, of which 13 return the readings I would expect, while 6 return values that are not what I would expect (as represented above).

    You asked about my sampling frequency and I can set up a timer and try to get that for you, but is there a limit to the sampling rate of the ADC? Also, I can plot the data for you, but I don't think it's a data inconsistency problem (meaning I consistently get incorrect values on the same pins, and the incorrect values are always the same). The data I've provided is representative of the samples I'm getting. But if you think it will be helpful, I'll do it.

    Thank you again for your help. The fact that the problem exists on a small subset of my channels is what's most confusing.

    Cindy
  • The data is consistent in the sense that it is uniform- it is inconsistent in that is is wrong, when compared to voltage being converted. That is what I've said from the beginning.
  • Cynthia Crutchfield said:
    AIN17: 1.8 volts ADC=1.42volts
    AIN18: 1.35 volts 1.18volts
    AIN20: 1.2 volts 1.63volts
    AIN21: 2.5 volts 3.01volts

    OK, 'scopes are not particularly accurate devices even when used with care. What they will give you is time dependence at high frequencies.  Make sure you measure at high frequencies, particularly if you can get to nS or better resolution.

    What is your reference?

    Cynthia Crutchfield said:
    AIN21: 2.5 volts 3.01volts

    You said you have a 3V reference.  Although you can get A/Ds that convert above the reference voltage I haven't seen that on any of the TIVA series micros. Although I would expect saturation. My worst case expectation on that is that the A/D might take several conversions to recover from saturation.

    Cynthia Crutchfield said:
    You asked about my sampling frequency and I can set up a timer and try to get that for you, but is there a limit to the sampling rate of the ADC?

    My worry is you are sampling too slowly. You need to have measurements at around a kHz rate IIRC in order to meaningfully consider whether you match the signal.  Too slow and you are only picking occasional sections.  Too fast and you never see the actual variations.

    Robert

  • Robert Adsett said:
    Make sure you measure at high frequencies, particularly if you can get to nS or better resolution.

    And that should be single shot conversion. 

    Probably not the problem but what you are looking for are narrow spikes in the signal.

    Robert

  • Hello Cynthia

    You mentioned that there is a resistor divider on the channels. What if the R divider are violating the Max Impedance?

    Secondly it if it is a R divider, it would be easier to remove the resistors and then connect a direct current limited input from a bench power supply to check if the conversion still holds the same value for the same voltage.

    Regards
    Amit
  • Got it.  Let me share this with the HW engineer and investigate.  Thanks for giving me a direction to work on...

    Cindy