My initialization is below
ADCcore is a structure that holds the different options.
void IEC60730_ADCinit(void)
{
/* Configuration for the ADC Core */
ADCcore.clockSourceSelect = SD24_B_CLOCKSOURCE_SMCLK;
ADCcore.clockPreDivider = SD24_B_PRECLOCKDIVIDER_1;
ADCcore.clockDivider = SD24_B_CLOCKDIVIDER_4;
ADCcore.referenceSelect = SD24_B_REF_INTERNAL;
SD24_B_init( SD24_BASE, &ADCcore);
/* Configuration for ADC0 */
ADC.converter = SD24_B_CONVERTER_0;
//ADC.alignment = SD24_B_ALIGN_LEFT;
ADC.startSelect = SD24_B_CONVERSION_SELECT_SD24SC;
ADC.conversionMode = SD24_B_SINGLE_MODE;
ADC.dataFormat = SD24_B_DATA_FORMAT_2COMPLEMENT;
ADC.sampleDelay = SD24_B_FOURTH_SAMPLE_INTERRUPT;
ADC.oversampleRatio = SD24_B_OVERSAMPLE_512;
ADC.gain = SD24_B_GAIN_32;
SD24_B_initConverterAdvanced( SD24_BASE, &ADC);
/* Configuration for ADC1 */
ADC.converter = SD24_B_CONVERTER_1;
//ADC.alignment = SD24_B_ALIGN_LEFT;
ADC.startSelect = SD24_B_CONVERSION_SELECT_SD24SC;
ADC.conversionMode = SD24_B_SINGLE_MODE;
ADC.dataFormat = SD24_B_DATA_FORMAT_2COMPLEMENT;
ADC.sampleDelay = SD24_B_FOURTH_SAMPLE_INTERRUPT;
ADC.oversampleRatio = SD24_B_OVERSAMPLE_512;
ADC.gain = SD24_B_GAIN_32;
SD24_B_initConverterAdvanced( SD24_BASE, &ADC);
return; /* < indicates completion, no intermediate status */
} /* IEC60730_ADCinit */
and I am getting stuck at the while loop below. I've looked at the code but there must be something I am missing.
SD24_B_clearInterrupt( SD24_BASE, SD24_B_CONVERTER_0, SD24_B_CONVERTER_INTERRUPT);
SD24_B_startConverterConversion( SD24_BASE, SD24_B_CONVERTER_0);
while(!SD24_B_getInterruptStatus( SD24_BASE, SD24_B_CONVERTER_0, SD24_B_CONVERTER_INTERRUPT)) {; }
ADCval0[1] = SD24_B_getHighWordResults( SD24_BASE, SD24_B_CONVERTER_0);
Could you get me initialization code for channels 0 and 1?
Steve