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.

TMS320F28034: AdcOffsetSelfCal() seems it has to avoid the errata "ADC: Initial Conversion"

Part Number: TMS320F28034
Other Parts Discussed in Thread: C2000WARE

Hi Champs,

According to the errata  

To ensure that the offset remains within the data sheet's “single recalibration”
specifications, perform the AdcOffsetSelfCal() function after Device_cal() has
completed and the ADC has been configured.

I have checked the AdcOffsetSelfCal() in C:\ti\c2000\C2000Ware_3_01_00_00\device_support\f2803x\common\source\DSP2803x_Adc.c.
It has the sentence AdcConvMean = AdcConversion();         //Capture ADC conversion on VREFLO    in the DSP2803x_Adc.c.

AdcConversion(void){
 :
Sum += AdcResult.ADCRESULT0;     // Hitoshi thinks this is the first conversion.
Sum += AdcResult.ADCRESULT1;
 :

I believe that the fist conversion result must be discarded due to the errata "ADC: Initial Conversion."
Could you please check the AdcConversion() above which I think some modification has to be taken care.

For example, dummy read must be added into the AdcOffsetSelfCal(), etc.
Otherwise, I am concerned that it might cause negative influence for the ADC accuracy measurement.

Thank you in advance for your kind check and sharing the resolution for it.
Best regards,
Hitoshi

  • Hitoshi-san,

    Yes, the best practice is to discard the first sample.  In the case of the offset calibration example, the creator thought that the sample size of 256 conversions was large enough to mitigate the error that is contributed by the first sample.

    -Tommy

  • Hi Tommy,

    If the index and the SampleSize are utilized the same value, it is the acceptable modification for AdcConversion(void) as follows?

    AdcConversion(void){
     :
    // Sum += AdcResult.ADCRESULT0;     // Hitoshi thinks this is the first conversion. This is discarded.
    Sum += AdcResult.ADCRESULT1;
    Sum += AdcResult.ADCRESULT1;        // ADCRESULT1 is added twice instead of ADCRESULT0
     :
     :
    AdcRegs.ADCINTFLGCLR.bit.ADCINT2 = 1; //clear ADCINT2 (INT2CONT = 0)
    // Sum += AdcResult.ADCRESULT8;     // Hitoshi thinks this the first conversion too. This is discarded.
    Sum += AdcResult.ADCRESULT9;
    Sum += AdcResult.ADCRESULT9;        // ADCRESULT9 is added twice instead of ADCRESULT8

    A customer would like an example code for the correction.
    Thank you in advance for your kind check.
    Best regards,
    Hitoshi

  • Hitoshi-san,

    What you have shown is acceptable, but be aware that there will be a loss of good samples in addition to the first invalid sample.

    For example:

    • All ADCRESULT8 results will always be valid because the ADC converter is continuously operating in the loop
    • All ADCRESULT0 results are being discarded, but only ADCRESULT0 from the first loop iteration is invalid

    I recommend looking at the adc_periodic_offset_calibration example if periodic calibration is desired.

    -Tommy

  • Hi Tommy,

    Let me double check the errata ADC: Initial Conversion with you.
    According to the errata, it says "When the ADC conversions are initiated by any source of trigger in either sequential or simultaneous sampling mode, the first sample may not be the correct conversion result."

    For the example code "DSP2803x_Adc.c", ADCINT2 starts SOC0-7 and  ADCINT1 starts SOC8-15.
    It seems ADCINT2 and ADCINT1 are the triggers and SOC0 and SOC8 are the fist conversion after the triggers.

    It seems they are triggers.
    Thank you for your kind clarification.

    Best regards,
    Hitoshi





  • Hitoshi-san,

    The Initial Conversion error only occurs when the ADC converter is allowed to idle. For most applications, the ADC conversions are triggered periodically with idle conversions cycles between conversion series that are triggered by different sources. Therefore, the the Advisory is worded to recommend discarding the first sample of each triggered series.

    In the case of continuous, self-triggering conversions, the ADC conversion pipeline is constantly loaded so there are no idle conversion cycles. The entire output of the 256-sample loop in AdcConversion() can be considered to be a single series when applying the workaround.

    -Tommy

  • Hi Tommy,

    Thank you for your kind explanation.
    I understood and will take care of the errata accordingly.

    Thank you very much again.
    Best regards,
    Hitoshi