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.

TMS320F28386D: ADC precision

Part Number: TMS320F28386D
Other Parts Discussed in Thread: C2000WARE

Dear experts,

for my work I am programming the ADC module in accordance with the TI examples.

Here below the main settings:

    ADC_setPrescaler(ADCD_BASE, ADC_CLK_DIV_4_0);

    ADC_setMode(ADCD_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED);
    
    ADC_setInterruptPulseMode(ADCD_BASE, ADC_PULSE_END_OF_CONV);

    ADC_enableConverter(ADCD_BASE);
    
    DEVICE_DELAY_US(1000);
    
    ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_SOC_NUMBER0, 15);
    


By considering VREFH=3V and VREFL=0V, a  DC voltage equal to 1.4989V is converted in a digital code equal to 2044.

By calculation, the correct code would be 2046. 

Please, note that the calibration of the device is made by means of the TI-function ADC_setMode.

Did I perform an error in programming the ADC?

Thank you in advance.

Best regards,

Benito

  • Hi Benito,

    Can you please check whether you are configuring the reference voltage for the ADC correctly? Please check if set_VREF() is configured correctly. 

    Also, can you provide a scope of the voltage supplied to the pin? The ADC conversion result depends on the accuracy of the reference signal and the input signal being converted. The result is off by 2 codes only. So, I believe it would be because of the accuracy of these signals.

    Regards,

    Meghavi

  • Dear Meghavi Tank,

    thank you for your support. 

    Can you please check whether you are configuring the reference voltage for the ADC correctly? Please check if set_VREF() is configured correctly.

    Where is this function? I do not find it within the C2000Ware_3_04_00_00..

    A similar function (ADC_setVREF) is privided for f2802x but it is missing for f2838x...

    Also, can you provide a scope of the voltage supplied to the pin? The ADC conversion result depends on the accuracy of the reference signal and the input signal being converted. The result is off by 2 codes only. So, I believe it would be because of the accuracy of these signals

    I carried out an experimental measure of the VREFHI and VREFLO applied to my F8388x. The real value is 3.0011V, instead of nominal  3V.

    By considering VREFH=3V and VREFL=0V, a  DC voltage equal to 1.4989V is converted in a digital code equal to 2044.

    By calculation, the correct code would be 2046. 

    By repeating this calculation with VREFH=3.0011, the DC voltage should be converted in 2045.7 (hence, about 2046)...The ADC result in my code is 2044...

    Therefore, the  accuracy of the reference signal  is very high and the small difference (0.0011V) does not justify the difference of 2 codes...

    Best regards,

    Benito

  • Hi Benito,

    Apologies, please ignore the ADC_setVREF() function. It is not used for f2838x devices. 

    Can you provide the graph of the 3V reference and DC voltage 1.49V signals? I would like to check the accuracy of these signals. Also, the conversion results can be influenced by the impedance of the analog input channel used. Any resistance and capacitance on the pin would affect sample and hold time settings that would be sufficient to charge the internal sampling capacitor of the ADC. More on this topic is available on the Technical Reference Manual section 15.13.2 (Choosing and Acquisition Window Duration).

    Regards,

    Meghavi

  • Dear Meghavi,

    thank you for your suggestions.  

    I measured the DC voltages (1.4989V and 3.0011V) by means of a high precision multimeter.

    Any resistance and capacitance on the pin would affect sample and hold time settings that would be sufficient to charge the internal sampling capacitor of the ADC.

    I evaluated that my sample time has to be higher than 70us. Indeed I set the ACQ divider equal to 20, instead of 15 as reported in TI examples.

        ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_SOC_NUMBER0, 20);

    However, the ADC result (2044) does not change, 

    Benito

  • Hi Benito,

    Can you please try checking a different input voltage apart from 1.4989V and let me know the results?

    Regards,

    Meghavi