Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE
Hi ,
I am bale to work with single ended adc in continuous mode for ADC B,C,D. But i want to use the ADC A as differential in continuous mode and i am not able to do it. i want tot use A2 and A3 as differential signal and A4 and A5 other differntial signal. It working in normal mode in while loop but i am unable to work it in continuous mode.
Please find my code for this and suggest me what to do. it is giving wrong data.
void Setup_AdcDifferentialContinuous()
{
uint16_t acqps;
acqps = 63; // 150ns
ADC_setPrescaler(ADCA_BASE, ADC_CLK_DIV_3_0);
//
// Set resolution and signal mode (see #defines above) and load
// corresponding trims.
//
ADC_setMode(ADCA_BASE,ADC_RESOLUTION_16BIT, ADC_MODE_DIFFERENTIAL);
// Set pulse positions to late
//
ADC_setInterruptPulseMode(ADCA_BASE, ADC_PULSE_END_OF_CONV);
//
// Power up the ADCs and then delay for 1 ms
//
ADC_enableConverter(ADCA_BASE);
TRACE_I(ADC_TRACE,"adc differential continuous mode config init \r\n");
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY,
ADC_CH_ADCIN2, acqps);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY,
ADC_CH_ADCIN3, acqps);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER1, ADC_TRIGGER_SW_ONLY,
ADC_CH_ADCIN4, acqps);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER1, ADC_TRIGGER_SW_ONLY,
ADC_CH_ADCIN5, acqps);
ADC_setInterruptSOCTrigger(ADCA_BASE, ADC_SOC_NUMBER0,
ADC_INT_SOC_TRIGGER_ADCINT1);
ADC_setInterruptSOCTrigger(ADCA_BASE, ADC_SOC_NUMBER1,
ADC_INT_SOC_TRIGGER_ADCINT1);
//
// Disable Interrupt flags
//
ADC_disableInterrupt(ADCA_BASE, ADC_INT_NUMBER1);
//
// Enable continuous mode
//
ADC_enableContinuousMode(ADCA_BASE, ADC_INT_NUMBER1);
//
// Configure interrupt triggers
//
ADC_setInterruptSource(ADCA_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER0);
//ADC_setInterruptSource(ADCA_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER1);
ADC_enableInterrupt(ADCA_BASE, ADC_INT_NUMBER1);
// Clear interrupts
HWREGH(ADCA_BASE + ADC_O_INTFLGCLR) = 0x000F;
ADC_forceMultipleSOC(ADCA_BASE, ADC_FORCE_SOC0 | ADC_FORCE_SOC1);
}


