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.

CCS/TMS320F28054F: Unexpected values read from ADC

Part Number: TMS320F28054F

Tool/software: Code Composer Studio

I am trying to read constant voltages from ADC inputs ADCINA6, ADCINB4, and ADCINB6. My understanding is that all of these pins have a fixed gain ~= 3.

I have measured all 3 of these inputs to have the same voltage (~0.72 V) at the point of the input, so I expect to read ~2680 counts for each conversion ((0.72 V / 3.3 V)*4095*3).

Instead, I read:

ADCINA6: 831

ADCINB4: 277

ADCINB6: 336

Another interesting note is that as I decrease voltage of the entire system, A6 decreases while B4 and B6 do not. Changing the voltage does not change the input voltage measured on any of these 3 pins, so this doesn't make any sense. This leads me to believe that I have the ADC configured to read the wrong input, but I think my CHSEL settings are correct. Below is the code to configure the ADC SOCs. SOC0 reads the voltage of the system and does so correctly.

EALLOW;
AdcRegs.ADCCTL1.bit.INTPULSEPOS= 1; //ADCINT1 trips after AdcResults latch
AdcRegs.INTSEL1N2.bit.INT1E = 1; //Enabled ADCINT1
AdcRegs.INTSEL1N2.bit.INT1CONT = 0; //Disable ADCINT1 Continuous mode

AdcRegs.INTSEL1N2.bit.INT1SEL = 2; //setup EOC2 to trigger ADCINT1
AdcRegs.ADCSOC0CTL.bit.CHSEL = 5; //set SOC0 channel select to ADCINA5 //VDC Bus
AdcRegs.ADCSOC1CTL.bit.CHSEL = 6; // ADCINA6 = 6
AdcRegs.ADCSOC2CTL.bit.CHSEL = 12; // ADCINB4 = 12
AdcRegs.ADCSOC3CTL.bit.CHSEL = 14; // ADCINB6 = 14
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 1; //set SOC0 start trigger on CPU Timer 0
AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 1; //set SOC1 start trigger on CPU Timer 0
AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 1; //set SOC2 start trigger on CPU Timer 0
AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 1; //set SOC3 start trigger on CPU Timer 0
AdcRegs.ADCSOC0CTL.bit.ACQPS = 9; //SOC0 S/H Window = 10 (9+1) Clk Cycles
AdcRegs.ADCSOC1CTL.bit.ACQPS = 9; //SOC0 S/H Window = 10 (9+1) Clk Cycles
AdcRegs.ADCSOC2CTL.bit.ACQPS = 9; //SOC0 S/H Window = 10 (9+1) Clk Cycles
AdcRegs.ADCSOC3CTL.bit.ACQPS = 9; //SOC0 S/H Window = 10 (9+1) Clk Cycles
EDIS;

CPU timer 0 is configured correctly, as I can see the ADC results updated in real time in the memory browser. After conversion, in the adc_isr() function I add AdcResult.ADCRESULT0...3 to 4 corresponding arrays, which I use to view the results.

Are there other ADC settings that could be manipulating my results? Am I understanding the fixed gain of 3 correctly? Also, is it possible to add a programmable gain to these pins, and how would you do that?

Thanks