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.

F28377D ADC results problem with two SOC

Hi,


We are using F28377D with docking station for multilevel converter. We need to convert large number of analog signals and configured the ADC-A, ADC-B, ADC-C,ADC-D with  SOC0 and SOC1. The results of the ADCs are not correct particularly when the input signal is on higher side.  The TI example code  adc_soc_epwm gives accurate results with single conversion (with only SOC0). However, when we modified the SetupADCEpwm() function as below, the ADC results are not correct.  In the modified code, we initiate the trigger after the end of SOC1 conversion instead of end of SOC0 conversion. For the testing, we connected the DACA (pin 9)  output to the ADC-A2 input (15) externally and modified the DACA data register from code. For this we made the channel select for ADC-A from A0 (as in example ) to A2.

Altogether we need to convert 14 signals at the sampling rate of 20000 Hz.. What is the suggested configuration for this?

void SetupADCEpwm(Uint16 channel)
{
    Uint16 acqps;

    //determine minimum acquisition window (in SYSCLKS) based on resolution
    if(ADC_RESOLUTION_12BIT == AdcaRegs.ADCCTL2.bit.RESOLUTION){
        acqps = 14; //75ns
    }
    else { //resolution is 16-bit
        acqps = 63; //320ns
    }

    //Select the channels to convert and end of conversion flag
    EALLOW;
    AdcaRegs.ADCSOC0CTL.bit.CHSEL = channel;  //SOC0 will convert pin A0
    AdcaRegs.ADCSOC0CTL.bit.ACQPS = acqps; //sample window is 100 SYSCLK cycles
    AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 5; //trigger on ePWM1 SOCA/C
   

    //Added lines for the second input
    AdcaRegs.ADCSOC1CTL.bit.CHSEL = 3;  //SOC0 will convert pin A0
    AdcaRegs.ADCSOC1CTL.bit.ACQPS = acqps; //sample window is 100 SYSCLK cycles
    AdcaRegs.ADCSOC1CTL.bit.TRIGSEL = 5; //trigger on ePWM1 SOCA/C
   
    //Modified to trigger the event at the end of SOC1 instead of SOC0
    AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 1; //end of SOC1 will set INT1 flag


    AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1;   //enable INT1 flag
    AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //make sure INT1 flag is cleared
}

We also looked at the suggestion at  https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/349011 but could not resolve the problem. 

-Shambhu

  • Shambhu,

    Can you see if increasing the ACQPS window improves your results?  If it does, you might be seeing the effects of Advisory ADC Input Multiplexer Connection at Beginning of Acquisition Window.

    -Tommy

  • With the increased ACQPS, its working properly. Thanks Tommy!!

    Sorry for late update.

    -Shambhu