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.

TM4C1294KCPDT: ADC0 FIFO LSB MSB

Guru 56308 points

Part Number: TM4C1294KCPDT
Other Parts Discussed in Thread: TIDA-00909, INA240

Previous thread said it would seem 1/4 LSB resolution FIFO bit values (yellow box) are not being shifted during conversion into MSB bit positions relative to NSH acquisition points. Perhaps default NSH 0x4 is holding the required FIFO shift (LSB->MSB) above 1/2 LSB forcing the true results into error status. Multiplying PWM duty cycle by FIFO array[] results tells us bit shift (circular) of 1/4 LSB sample integers into correct MSB bit positions in circular FIFO is not occurring. Otherwise we have digital compression relative 3.3v full scale from the resulting FIFO value 1/2 LSB error being read into the software Array[]. 

Seemingly the reason 1/2 LSB error FIFO shifting (Cext charge sharing) is not so obvious with pure DC signal is the FIFO results always return 1/2 LSB (steady state) values. That hides the 1/2 LSB error by engineers adjusting SW low pass filtering to compensate for 1/2 LSB error until the correct DC digital value is achieved. Basically software morphs 1/2 LSB FIFO error into MSB shifted results by integer manipulation of each sample value via software low pass filtering. It would seem some kind of converter errata or FIFO  clock rate not being 16x the serial bit rate relative to NSH sample clocking. 

Can engineering have a look at why the Cext 1/4 LSB results (yellow box) are not being shifted into MSB bit positions as expected they should? Seemingly cADC or NSH charging do not produce 1/4 LSB FIFO results consistent with or to 3v3 full scale unless perhaps the AINx signal has mostly linear steady state attributes. Only a hypothesis at this point sequencer samples (yellow box) actually represent 1/2 LSB error shifted into FIFO incorrectly when we are expecting 1/4 LSB results to be circular shifted into higher MSB bit positions relative to 3v3 full scale.

The 840mv (Csamp) started much lower value (50mv) at the beginning of sampling, slowly rising 840mv over several seconds in capture below. That slow linear rise is not being transferred into the FIFO returned results but maybe total of 100mv if even.  Yet the charge sharing peaks Cext are present in the FIFO results without linear slope and rise. ADC0: 60/30Mhz ADCCLK, single ended AINx inputs.

  • BP101,
    To be honest I don't follow you. The external capacitor that reduces the charge sharing with the internal capacitance will not scale the input nor should it affect the most significant bits of the result. As CB1 pointed out in the earlier post, the hardware (or software) averaging is to minimize the impact of random noise that is in the system. It will not be able to create additional resolution. While it might help with the error due to charge sharing, it is a very inefficient way to do that. Increasing the sample time (NSH) is a better way. Using an external sample capacitor is helpful when there is a high source impedance, and it acts as a low pass filter. The 1NA240 does not have a large source resistance. However, remember that the sample multiplexer inside the TM4C can have up to 2.5K Ohms of input impedance.

    If I am not addressing your concern, please help me to understand. Perhaps backing off and giving me the big picture first.
  • Vendor's 'Bob' - stands NOT alone - in 'not following'  these '1/4, 1/2' lsb 'deep dives.'

    Exactly as vendor's 'Bob'  properly notes:

    • the 'Big Picture' has (either) been
      • Too rapidly fast-forwarded - or
      • never presented

    The end result (for Bob & myself) is 'high confusion.'      May it be said that,  'poster (appears) to know what he seeks - yet proves (pardon) 'unable and/or unwilling' - to fully/properly convey his Goal's ESSENCE!     And - minus that clarity - the 'helper crüe' cannot (effectively) aid.

    It seems 'reasonable' that poster is seeking (even) higher (at least improved) performance from the MCU's ADC.     And - as earlier noted - NO MCU is 'famed' as providing the 'Optimally Performing' ADC.   Might poster's 'Substantially Improved ADC Performance' - be (best & easiest) achieved - via the employ of, 'One of this vendor's MANY, High Performance, Dedicated ADCs?'

    Such 'Dedicated ADC component' may be (more ideally):

    • placed far closer to 'board edge'  (shortens trace length/reduces antenna effect)
    • easier to 'opto-couple or otherwise power isolate' - both techniques (sure) to improve results
    • capture ADC data at faster rates (via higher speed conversions)
    • capture ADC data at extended 'dynamic range' (via higher resolution conversions)
    • capture ADC expertise - from (more) 'ADC focused personnel' (who may 'also' - request the (always) dreaded, 'Big Picture')

  • Hi Bob,

    Bob Crosby said:
    . The external capacitor that reduces the charge sharing with the internal capacitance will not scale the input nor should it affect the most significant bits of the result

    I'm just repeating what it states in the Hercules PDF posted in other thread. Other TI analog SAR documents all specify signal acquisition LSB 1/4 to 1/2 setting must be achieved, anything above 1/2 is considered error. That seems to infer anywhere the acquisition point is in the 1/4 LSB trough (Csamp) as sample moves linear upwards it gets either added or subtracted from the full 3v3 scale to create (monotonic) slope by moving values into MSB as the signal peaks move upward, that ain't happen. The samples are not to scale in any way relative to ADC 3v3 full scale. The analog scale is 10mV/A or otherwise with no filtering what so ever same results occur with any Nsh value being set. Seemingly the acquisition point is slipping off the 1/4 LSB of any Nsh hold value and peaking over 1/2 LSB into full error, so the scale is way off. Also may be the SAR is not capable to properly decode certain RMS signals when parts of it remain below 1/8 LSB. We do have other PWM acquisitions 3 AINx channels but the samples occur below 1/8 LSB, that is ok for detecting zero crossing events under 500mv.      

    It seems the SAR is not scaling the sample results as peaks (yellow box) moves linear upward off the sample floor. So current measures remain on the floor versus sloping upward as current rises. Otherwise without multiplying the FIFO results by the PWM duty cycles the analog signal being sampled is very narrow to start and only widens in scope widgets. It or 1/4 LSB should rise off the floor as analog peaks rise resulting from LSB analog samples (Nsh 0x4) stepping upward in to MSB positions, that is charge sharing and hold as one. That is 1/4 LSB resolution as I see it but the TM4C SAR is not locking acquisition to Csamp troughs and not projecting an analog slope via MSB shifts along the way. So the sample results of the wave form are less than precision. The INA240 was tested SAR compatible via Piccolo TIDA-00909, should not have any issue with TM4C SAR ADC, yet it does not work properly seemingly because of hold charge slipping during acquisition, perhaps errata #14?  

    Bob Crosby said:
    Increasing the sample time (NSH) is a better way. Using an external sample capacitor is helpful when there is a high source impedance, and it acts as a low pass filter. The 1NA240 does not have a large source resistance. However, remember that the sample multiplexer inside the TM4C can have up to 2.5K Ohms of input impedance.

    Well Cext (20n) has already reduced ANIx input impedance near (550 ohms), Tina AC analysis confirms RMS impedance value. Rs can be further reduced increasing Cext but the 16 channel 12bit SAR (table1) when Rs=200ohms is 134ns to 1/2 LSB settling time in the acquisition. That means Rs=550 ohms 1/2 LSB settling is roughly double (268ns), can't get much better settling than that with NSH=0x4. The INA signal has to be extensively filtered of EMI transients otherwise Cext=200pf floods the ADC with huge EMI yet it still works. That filtering pushes up open loop gain 1/4 LSB into overshoot but SW can reduce results via division, that is if TM4C SAR could lock onto the acquisition slope.

  • Again Cext charge sharing with CADC during sampling of periodic signals has no effect on TM4C NSH values to hold and move LSB into MSB bit positions causing monotonic increase of integers during sample recovery. I am describing some kind of errata resulting from perhaps incorrect FIFO clocking or other conversion failure when hardware oversampling is also enabled.

    What worked with M3 SAR hardware averaging and OP amps is not working with INA240 as it should with TM4C SAR. It can't be that difficult to achieve monotonic integers in a rising signal if the SAR is actually holding the charge after settling. It appears the ADC internal hold charge is being rapidly dumped each 80us period even though we see results of charge sharing in the capture.
  • The only part of the signal we attempt to recover during interrupt is in the yellow box, not so much the lower portion. Though some how lower portion of wave form is mostly being sampled not keeping monotonic current slope. 
     

  • The (now twice requested) 'Big Picture' is as 'likely to arrive here' - as the 'NY Mets (overtaking) the BoSox!'    (wrong league - & 40 games out!)
    You may consider the simple fact that (Not Everyone here) 'lives/breathes' the (ongoing) 'BP-Saga' - and 'Big Picture' detail - really IS required...

    'Your way' has led directly to your plight - 'Helper suggestions receive 'No/zero comment/trial' - does that not (signal) that the 'Hercules Crüe' should, 'Ready their group for (this week's) issue du jour?

    Communication IS a 'two-way' street - and when Vendor and even (so delightful) an outsider - receive, 'No Answer' - motivation plunges!     (almost as fast/far - as that suspect '1/4 lsb!')

  • Not sure what you are implying as you seemed to understand, maybe jumped to quickly resolved status? Did you not comprehend the Hercules SAR is industry typical? Look at table 1 read the dang PDF many times! this thread is about 1/2 to 1/8 microvolt acquisition points in a ramping signal, no different from TM4C1294 SAR acquisitions. You seemed to be on Q with 1/4 LSB not moving into MSB bit cells as the signal grows in magnitude.

    The SAR AD conversions Cext charge sharing for any pulsing signal act like a ratchet on a trailer winch. If you ever owned a boat hoisting manually onto trailer via detachable hand winch you know what happens if ever the lock pin jumps your not paying attention. If not ever an owner, short story short - e.g. the dang handle flys off the shaft typically smacking one very hard in the arm or chest.