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.

A can not get data 16bit ADC from 28337.

Hello!

This is my cod:

void ConfigureADC(void)
{
EALLOW;

//write configurations
AdcaRegs.ADCCTL2.bit.PRESCALE = 14;//6; //set ADCCLK divider to /4
AdcaRegs.ADCCTL2.bit.RESOLUTION = RESOLUTION_16BIT;//RESOLUTION_12BIT;
AdcaRegs.ADCCTL2.bit.SIGNALMODE = SIGNAL_DIFFERENTIAL;//SIGNAL_SINGLE;

//Set pulse positions to late
AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1;

//power up the ADC
AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1;

//write configurations
AdcbRegs.ADCCTL2.bit.PRESCALE = 14;//6; //set ADCCLK divider to /4
AdcbRegs.ADCCTL2.bit.RESOLUTION = RESOLUTION_16BIT;//RESOLUTION_12BIT;
AdcbRegs.ADCCTL2.bit.SIGNALMODE = SIGNAL_DIFFERENTIAL;//SIGNAL_SINGLE;

//Set pulse positions to late
AdcbRegs.ADCCTL1.bit.INTPULSEPOS = 1;

//power up the ADC
AdcbRegs.ADCCTL1.bit.ADCPWDNZ = 1;

//delay for 1ms to allow ADC time to power up
DELAY_US(1000);

EDIS;
}

void SetupADCEpwm(void)
{
Uint16 acqps;

//determine minimum acquisition window (in SYSCLKS) based on resolution
if(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 = 4; //SOC0 will convert pin Ax
AdcaRegs.ADCSOC0CTL.bit.ACQPS = acqps; //sample window is 100 SYSCLK cycles
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 5; //trigger on ePWM1 SOCA/C

// AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 0; //end of SOC0 will set INT1 flag
// AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag
// AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //make sure INT1 flag is cleared

AdcbRegs.ADCSOC0CTL.bit.CHSEL = 3; //SOC0 will convert pin Ax
AdcbRegs.ADCSOC0CTL.bit.ACQPS = acqps; //sample window is 100 SYSCLK cycles
AdcbRegs.ADCSOC0CTL.bit.TRIGSEL = 8; //trigger on ePWM2 SOCB/D

EDIS;
}

I get data by DMA in buffer.But data there is 12 bit!!!!

Help me please.