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.

LAUNCHXL-F28379D: Problem with ADCINA2.

Part Number: LAUNCHXL-F28379D

Hi,

i have LaunchPad F28379D. I have to read 4 ADC (A0,A1,A2,A3) and the trigger of SOC0,1,2,3 is the PWM5. The measurements are correct for A0,A1,A3 but are wrong for A2. Where am I wrong?

The code for setup ADC and ISR is (If it is helpful I write the full code):

void SetupADCEpwm(Uint16 channel)
{
Uint16 acqps;
if(ADC_RESOLUTION_12BIT == AdcaRegs.ADCCTL2.bit.RESOLUTION){
acqps = 14;}
else { acqps = 63; }

//Select the channels to convert and end of conversion flag
EALLOW;
AdcaRegs.ADCSOC0CTL.bit.CHSEL = 0; //SOC0 will convert pin A0 (PIN30)
AdcaRegs.ADCSOC0CTL.bit.ACQPS = acqps;
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 13; //Trigger source ePWM5A

AdcaRegs.ADCSOC1CTL.bit.CHSEL = 1; //SOC0 will convert pin A1 (PIN50)
AdcaRegs.ADCSOC1CTL.bit.ACQPS = acqps;
AdcaRegs.ADCSOC1CTL.bit.TRIGSEL = 13; //Trigger source ePWM5A

AdcaRegs.ADCSOC2CTL.bit.CHSEL = 2; //SOC2 will convert pin A2 (PIN29)
AdcaRegs.ADCSOC2CTL.bit.ACQPS = acqps;
AdcaRegs.ADCSOC2CTL.bit.TRIGSEL = 13; //Trigger source ePWM5A

AdcaRegs.ADCSOC3CTL.bit.CHSEL = 3; //SOC3 will convert pin A3 (PIN26)
AdcaRegs.ADCSOC3CTL.bit.ACQPS = acqps;
AdcaRegs.ADCSOC3CTL.bit.TRIGSEL = 13; //Trigger source select, d=e

AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 3; //end of SOC3 will set INT1 flag
AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag
AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
EDIS;
}

interrupt void adca1_isr(void)
{
AdcaResults = AdcaResultRegs.ADCRESULT0;
AdcaResult1= AdcaResultRegs.ADCRESULT1;
AdcaResult2= AdcaResultRegs.ADCRESULT2;
AdcaResult3= AdcaResultRegs.ADCRESULT3;

AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //clear INT1 flag
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
EDIS;
}

Anyone with a good heart can tell me where I am wrong?