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.

Having trouble with the AD24 for the msp430afe253

Other Parts Discussed in Thread: MSP430AFE253, MSPDRIVERLIB

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

  • Hello Steve,

    It appears that you are attempting to use MSPDRIVERLIB with a MSP430AFE253 device, however the MSP Driver Library only supports MSP430F5x/6x, MSP430FRxx, MSP430i2x and MSP432P4x series devices. The MSP430AFE253 also has a SD24_A peripheral, not SD24_B. For these reasons I suggest you try referencing the TI-provided C code examples for this MSP variant instead.

    Regards,
    Ryan

**Attention** This is a public forum