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.

F28069 ADC readings require very large ACQPS values

Other Parts Discussed in Thread: CONTROLSUITE, INA213, OPA2365

We are running our F28069 with a 90 MHz clock, and using the internal 3.3 V reference for the ADC.  ADC readings, as viewed with the debugger, are consistently low with small ACQPS values like 6, 8 or 10.  They improve with higher values like 50.  And are best with values of 100 or more.

With ACQPS = 6, when I tie the input to one of the channels to GND the ADC reads 0 solidly.  When I tie it to 3.3 V, it reads 4081-4087.

With ACQPS = 200, GND reads 0-3, 3.3 V reads 4095 solid.

We have waited the required 1 ms after powering up the ADC, we run Device_cal() before using the ADC, and we perform the needed dummy ADC reads before each set of conversions.

Any suggestions?

Thanks.  -JD

  • Hi JD,

    With ACQPS = 6, when I tie the input to one of the channels to GND the ADC reads 0 solidly.  When I tie it to 3.3 V, it reads 4081-4087.

    With ACQPS = 200, GND reads 0-3, 3.3 V reads 4095 solid.

    If you use a RC filter at the ADC input, you can reduce the ACQPS value else you've to increase the value. This happens due introduction of noise.

    Regards,

    Gautam

  •  

    Hi John,

    The ACQPS is a 6-bit field and can only take a valid maximum of 63. The F28069 has a first sample issue in which the first conversion might not be the right result. This is documented in the errata. Are you averaging the results? One thing you could try is running the the adc_soc example from control suite and looking at the results in the Voltage[1] and Voltage[2] arrays.

     

    Regards,

    Frank.

  • I do have an RC filter on the input I am interested in with R=100 ohm.  C is across the ADC input to ground and is 0.047 uF to guard against charge injection.

    On the channel where I tested it with a short to GND or a short to 3.3 V, there is no filter.  A filter would not make a difference.  I used a piece of wire.

    So, that's not it.

  • JD, I personally use a RC filter with averaging of 16/32 values. But in my case the RC filter does improve the signal considerably. 

    Regards,

    Gautam

  • Frank Ankapong said:

    The ACQPS is a 6-bit field and can only take a valid maximum of 63.

    Oops, right you are.  I did some more testing with ACQPS <= 63 and see that ACQPS changes the reading as it increases, sometimes up and sometimes down, not always up as I had earlier reported.  Here's the data:

    |ACQPS|ADC in |Expected ADC out|ADC out     |Error (of reading)|
    |  63 |2.184 V|       2711     |2698 to 2703| -0.48% to -0.30% |
    |  32 |2.184 V|       2711     |2711 to 2720|  0.00% to +0.33% |
    |  16 |2.184 V|       2711     |2693 to 2697| -0.66% to -0.52% |
    |  12 |2.184 V|       2711     |2694 to 2698| -0.63% to -0.48% |
    |   8 |2.184 V|       2711     |2706 to 2710| -0.18% to -0.04% |

    |   6 |2.184 V|       2711     |2679 to 2683| -1.20% to -1.03% |

    Frank Ankapong said:

    The F28069 has a first sample issue in which the first conversion might not be the right result. This is documented in the errata.

    Yes, we are doing the needed initial dummy read at the beginning of each set of conversions.

    Frank Ankapong said:

    Are you averaging the results? One thing you could try is running the the adc_soc example from control suite and looking at the results in the Voltage[1] and Voltage[2] arrays.

    No, I am not averaging yet.  I will try the adc_soc example and let you know what I see.

    The thing I don't understand is, even though the results are noisy, why do all the readings tend to come in low for a given ACQPS or high for a different ACQPS.  If it was just noise, I'd expect them to be centered around the expected value, regardless of ACQPS.  If it is charge injection then I could understand this behavior.  But with a 0.047 uF cap across the input, I would expect the effects of charge injection to be minimal/undetectable.

    Thanks. -JD

  • 1. Not all ACQPS values less than 63 are valid. The ranges are 6-15, 59-63 and some valid ones in between (check the reference manual). From your results, 16 and 32 are not valid ACQPS.

    2. The inconsistency of your results could indicate you have a noisy source. If you have a signal generator which can output DC try that or a DC battery. This could help rule out the source as the issue.

    I will await your adc_soc run.

    Regards,

    Frank.

  • Frank Ankapong said:

    2. The inconsistency of your results could indicate you have a noisy source. If you have a signal generator which can output DC try that or a DC battery. This could help rule out the source as the issue.

    Hi, Frank,

    I figured that by tying the ADC input to ground, I couldn't get much quieter than that.  Yet the readings were different for different ACQPS.

    Will let you know the results of running adc_soc.

    Thanks for the heads up on valid ACQPS values.

    -JD

  • Hello,

    Currently, I am expecting the same difficulties as a topic starter.

    I'm studying F28069 USB stick evaluating its ADC possibilities. To be sure that a test software is OK I've launched "ADC - ContinuesADC" example from the latest ControlSuite.

    So, I am watching ADC-A2 channel (pin 2 on J1 header) that is shorted on pin4 (+3.3V) by wire. I am expecting ADC values near 4095 (full scale) but unfortunately it shows only in range of 3968...3980. That is equal to about 3,201 Volts instead of real 3,3V measured by voltmeter @ ADC pin.

    Need your explanation what I am doing wrong and please help me to resolve my problem to get desired 4095 ADC code!

    Thank you!

    P.S. after calibration I've got:

    ADCREFTRIM => 0x15AA

    ADCOFFTRIM => 0x0000

    P.P.S. I think I found correct answer by myself. After reading this http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/96901.aspx and this http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/96901.aspx it is now everything is clear for me.

    I have TMX sample chip welded on USB stick. So it is not calibrated at factory and I need to do manual fine calibration. Thanks those guys from posts above!

  • Hi, Frank,

    I have finally run the adc_soc example as promised a few months ago.  I set it up to read ADCINA0 (Voltage1) and ADCINB0 (Voltage2).  

    With a quiet 1.098 VDC at the input to ADCINA0 I would expect 1363 counts.  adc_soc produces 1349 to 1350 counts (about 13 counts low).

    With 2.175 VDC at the input to ADCINB0 I would expect 2699 counts.  adc_soc produces 2673 to 2675 counts (about 25 counts low).

    So my readings are still on the order of 1% below the expected readings.  

    The input noise on ADCIN0 is shown in the attached scope plot (tek00355.png)

    Yes, there appears to be a little bit of noise here.  It is certainly not much because the readings are only bouncing around by 1 or two LSBs.  If noise is the cause, as several folks here have suggested, why always read low and not sometimes high and sometimes low?

    Thanks.

    JD

  • Hi JD,

    Looks like your device is exhibiting gain error, but before going any further, i need to clarify if your device is TMS or TMX. If it is TMX, then it is not calibrated from the factory and hence this is expected and you should reference the above post. If it is TMS, then are you using the f28069 controlCard or controlSTICK or do you have the f28069 device in your own development board?

    Regards,

    Frank.

  • Hi, Frank,

    Yes, we are using the TMS320F28069PZ on our own motor drive board.  

    The input to ADCINA0 has a 2.2 uF ceramic capacitor to GND, located about 15 mm from the input pin.  This cap is driven by a TI INA213 current-shunt monitoring amplifier through a 100 ohm resistor.  

    The input to ADCINB0 is driven directly by a TI OPA2365 op-amp located about 20 mm from the input.

    The ACQPS value for both is 0x0A.

    Best,

    JD

  • Hi JD,

    Since your inputs A0 and B0 are not driven the same way, lets try to rule out any possible offset error. I would like you to still use the AdcSoc example but drive A0 with the two voltages and note down the results. Repeat for B0. 

    Regards,
    Frank

  • Have you tried doing zero offset ADC calibration?  Check AdcOffsetSelfCal() function located in F2806x_Adc.c in the common header files.  Procedure is also spelled out in section 8.1.9.2 of spruh18e.

  • Hi, Frank,

    I took another of our boards that has very little circuitry on it so that I could easily inject voltages into ADCINA0 and ADCINB0.  I put a 2.2 uF cap from each input to ground and used a bench supply to test at a number of voltages.  Here are the results.

    Clearly there are both an offset error of about 7 bits and a gain error.

    As to  Fulano de Tal's question about AdcOffsetSelfCal(), no I have not tried running that yet.

    JD

  • Hi JD,

    From your results, looks like you have an offset error of about 5-6LSB and a gain error of about 15LSB. You can run AdcOffsetSelfCal() to remove that offset but that would still leave you with the 15LSB gain error. Even though any amount of gain error is undesirable, the 15LSB gain error is within the specifications which is -40 to 40 LSB for external reference and -60 to 60 for internal reference. Now you have some options:

    1. You can use external reference for the ADC which depending on the quality of the reference, could give you better performance.

    2. You could try to recalibrate the gain performance for your application. This doesn't come without it's caveats however as all TMS devices are calibrated to be within specifications across all valid operating conditions whereas if you recalibrate it yourself, it might only be valid for that specific operating condition.

    PS: My one suggestion would be to guard band all your projects against device specifications, in this case, you would need to analyze your project and see if -40 to 40LSB of gain error is acceptable for your project.

    Regards,

    Frank.

  • Hi, Frank,

    Okay, we bit the bullet and added an external 3.00 V +/- 0.2% reference to one of the spare ADC inputs and we use that to calibrate the ADC every time we enable the motor drive.  This helps a lot.  Thank you very much.

    But this does not answer my original question.  Why does the accuracy of the readings change so much when using different (valid) values for ACQPS?  I do not believe it is a charge injection issue as we have a 2.2 uF ceramic cap (huge relative to the sampling cap of the ADC) from the ADC input to GND, and it is located within 2 cm of the input.

    Thank you.

    JD

  • Hi JD,

    From your preceding email, i see you refering to running the f28069 at 90Mhz clock. I'm assuming you mean the sysclk not the ADC clock as the ADC clock for the f28069 shouldn't be higher than 45Mhz. Concerning the ACQPS, the ACQPS is the ADC acquisition field that controls how long the input signal is sampled so higher values equate to longer sampling windows. If you are seeing better ADC accuracy with a longer sampling window, it likely means your input to the ADC at the pin is weak and hence it takes a longer time for the sampling cap to fully charge. You can try to buffer your input to the ADC pin and see if that helps.  

    Regards,

    Frank

  • Hi, Frank,

    Indeed, our SYSCLK is running at 90 MHz, and the ADC clock is running at 45 MHz.

    We are using a ceramic cap instead of an active buffer to drive that pin.  Shouldn't this make the input to the pin "strong"?  We tried this approach after trying a buffer because, for one, it avoids having to deal with the transient response of the buffer to the disturbance presented by the sampling cap to its output.  Shouldn't a 2.2 uF ceramic cap located close to the input pin be strong enough to resist charge injection?

    Originally we were driving this pin with a TI OPA2365AID configured as a gain-of-one buffer when we saw this problem.  That is when I decided to try the experiment with the 2.2 uF ceramic instead.  Same result.

    Thanks.

    JD

  • Hi JD,

    If you are running the ADC clock at 45 MHz then that should be fine. Charge injection comes from the sampling switch when it is turned off. The effect it has on the source is very little and the effect it has on the sampling cap is accounted for in the design. The 2.2uF ceramic cap you are using is very big relative to the 1.6pF sampling cap even if you would be primarily sampling DC. The ADC sees the voltage on the 2.2uF cap and if that isn't fully charged to your input voltage, it samples whatever voltage is on the pin. Something on the order of 100nF should be good enough even for DC applications.

  • Hi, Frank,

    But when I measured the voltage at the input to the ADC (the voltage across the 2.2 uF cap) with a DVM and compared it to the converted value, I found that the converted value accuracy improved with longer ACQPS values.  So, it seems to me that the 2.2 uF cap must be charged, on average, to its full voltage.  I purposefully chose this large capacitance value so that there would be no question of its voltage changing much due to charge injection.  We are sampling at 1000 Hz.  

    I certainly agree that it would seem this is a charge injection issue if longer ACQPS values make it more accurate, but if the DC level seems to be correct at the input, how could charge injection affect it with this large of a cap?  I suppose it could be ESR or ESL, but I would not expect them to be large enough to have an effect with a ceramic cap located within 2 cm of the input.

    Best regards,

    JD

  • Hi JD,

    You might be sampling at 1KHz but at 45MHz ADC clock, the maximum sampling window is 64 ADC clocks which works out to 1.42uS. DVMs have very slow sampling speeds and hence any intermittent voltage drops that occur when you begin to sample with the ADC might not be perceptible unless you are logging the DVM output and synchronizing it with the ADC trigger. The sampling switch of the ADC has a very small capacitance and hence any resultant charge from charge injection on a driven input is negligible, so whatever issue you are seeing is very unlikely to be a result of charge injection. What you are seeing is a very likely result of your source not being able to drive the ADC adequately. To find the root cause of your problem, you would need to analyze the RC model or your source and the RC model of the ADC which is included in the datasheet to see if the timings match up.

  • Hi, Frank,

    Modelling is a good suggestion.  Do you think that the capacitor ESL will play a significant roll?

    Originally we were driving the ADC directly with a TI OPA2365AID op-amp configured as a buffer.  For our higher-frequency signals, do you feel that this is an appropriate choice of op-amp for this?

    Thank you.

    JD

  • Hi JD,

    Inductance shouldn't have any effect on charge times unless you want to include resonance calculations. The TI OPA2365 has a bandwidth of 50MHz. At least as far as speed is concerned, you would be limited by the ADC not the OPA2365.

  • Hi, Frank,

    Okay, great.  I'll let you know the results of the modelling.

    Thanks!

    JD