Hi All,
I am facing this weird issue with one of my C2000 boards (custom). This board is for a PV charging application.
The code contains a EPWM trigger to ADC and ADCINT1 configured to run CLA TASK 1. ADC is working with 12 channels. The ADC conversion time is measured from EPWM1 ISR entry till CLA TASK 1 entry using a scope.
Condition 1: No PV input...
ADC conversion time is approx around 2 us.
Condition 2: I provide PV input
ADC conversion time seems to slew to 5.5us.
Not able to find a reason why this is happening.... Can the ADC module conversion time be variable based on physical inputs ?
There is no reference to ADC registers else where in code apart from the OVERLFOW and INT flag clearing.... I am providing the ADC init code below...
EALLOW; AdcRegs.ADCCTL1.bit.ADCBGPWD = 1; // Power ADC BG AdcRegs.ADCCTL1.bit.ADCREFPWD = 1; // Power reference AdcRegs.ADCCTL1.bit.ADCPWDN = 1; // Power ADC AdcRegs.ADCCTL1.bit.ADCENABLE = 1; // Enable ADC AdcRegs.ADCCTL1.bit.ADCREFSEL = 1; // Select external AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1; // ADCINT1 trips AFTER results latch AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1; AdcRegs.ADCCTL2.bit.CLKDIV2EN = 1; AdcRegs.INTSEL1N2.bit.INT1E = 1; // Enable ADCINT1 AdcRegs.INTSEL1N2.bit.INT1CONT = 1; // Enable continuous mode AdcRegs.INTSEL1N2.bit.INT1SEL = 6; // EOC6 is trigger for ADCINT1 AdcRegs.ADCSOC0CTL.bit.CHSEL = 0; // A0 >
AdcRegs.ADCSOC1CTL.bit.CHSEL = 1; // A1 >
AdcRegs.ADCSOC2CTL.bit.CHSEL = 8; // B0 > AdcRegs.ADCSOC3CTL.bit.CHSEL = 9; // B1 > AdcRegs.ADCSOC4CTL.bit.CHSEL = 10;// B2 >
AdcRegs.ADCSOC5CTL.bit.CHSEL = 11;// B3 >
AdcRegs.ADCSOC6CTL.bit.CHSEL = 12;// B4 >
AdcRegs.ADCSOC7CTL.bit.CHSEL = 13;// B5 >
// Analog Variable readings corresponding to 4 bit Hardware Version AdcRegs.ADCSOC8CTL.bit.CHSEL = 7; // A7 Bit 3 Pin 11 AdcRegs.ADCSOC9CTL.bit.CHSEL = 3; // A5 Bit 2 Pin 15 AdcRegs.ADCSOC10CTL.bit.CHSEL = 4; // A4 Bit 1 Pin 14 AdcRegs.ADCSOC11CTL.bit.CHSEL = 5; // A3 Bit 0 Pin 13 AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC4CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC5CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC6CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC7CTL.bit.TRIGSEL = 5; // EPWM1 SOCA // Analog Variable readings corresponding to 4 bit Hardware Version AdcRegs.ADCSOC8CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC9CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC10CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC11CTL.bit.TRIGSEL = 5; // EPWM1 SOCA AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; // minimum S/H Window size AdcRegs.ADCSOC1CTL.bit.ACQPS = 6; AdcRegs.ADCSOC2CTL.bit.ACQPS = 6; AdcRegs.ADCSOC3CTL.bit.ACQPS = 6; AdcRegs.ADCSOC4CTL.bit.ACQPS = 6; AdcRegs.ADCSOC5CTL.bit.ACQPS = 6; AdcRegs.ADCSOC6CTL.bit.ACQPS = 6; AdcRegs.ADCSOC7CTL.bit.ACQPS = 6; // Analog Variable readings corresponding to 4 bit Hardware Version AdcRegs.ADCSOC8CTL.bit.ACQPS = 6; AdcRegs.ADCSOC9CTL.bit.ACQPS = 6; AdcRegs.ADCSOC10CTL.bit.ACQPS = 6; AdcRegs.ADCSOC11CTL.bit.ACQPS = 6; EDIS;
Thanks in Advance...
Santhosh