Tool/software: Code Composer Studio
Hello,
I'm trying to set up the ADC on the MSP432E401Y to sample at 1 or 2 MSPS in One Shot Mode. For some reason, the code hangs when I set the sampling frequency to anything above 100 kHz. Is there some internal clock setting that I need to change to allow One Shot Mode to work at the maximum sampling rate? I'm working off of the adcbufcontinuous_MSP_EXP432E401Y_tirtos_ccs.
Here's my setup:
/* Call ADC driver init function */
ADCBuf_init();
//ADCClockConfigSet(ADC0_BASE, ADC_CLOCK_SRC_PLL | ADC_CLOCK_RATE_FULL, 24);
/* Set up an ADCBuf peripheral in ADCBuf_RECURRENCE_MODE_CONTINUOUS */
ADCBuf_Params_init(&adcBufParams);
//adcBufParams.callbackFxn = adcBufCallback;
adcBufParams.recurrenceMode = ADCBuf_RECURRENCE_MODE_ONE_SHOT;
//adcBufParams.returnMode = ADCBuf_RETURN_MODE_CALLBACK;
adcBufParams.returnMode = ADCBuf_RETURN_MODE_BLOCKING;
//adcBufParams.samplingFrequency = 20E6;
adcBufParams.samplingFrequency = 100000;
adcBuf = ADCBuf_open(Board_ADCBUF0, &adcBufParams);
if (adcBuf == NULL){
/* ADCBuf failed to open. */
while(1);
}
/* Configure the conversion struct */
oneshotConversion.arg = NULL;
oneshotConversion.adcChannel = Board_ADCBUF0CHANNEL0;
oneshotConversion.sampleBuffer = sampleBufferOne;
//continuousConversion.sampleBufferTwo = sampleBufferTwo;
oneshotConversion.samplesRequestedCount = ADCSAMPLESIZE;
while(1) {
sem_wait(&ADCGet);
/* Start converting. */
if (ADCBuf_convert(adcBuf, &oneshotConversion, 1) !=
ADCBuf_STATUS_SUCCESS) {
/* Did not start conversion process correctly. */
while(1);
}
// Normalize and convert to uVolts
/* Adjust raw ADC values and convert them to microvolts */
ADCBuf_adjustRawValues(adcBuf, oneshotConversion.sampleBuffer, ADCSAMPLESIZE,
Board_ADCBUF0CHANNEL0);
ADCBuf_convertAdjustedToMicroVolts(adcBuf, Board_ADCBUF0CHANNEL0,
oneshotConversion.sampleBuffer, microVoltBuffer, ADCSAMPLESIZE);
Best,
Ajay