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.

MSP432E401Y: Problems Using ADCBUF one_shot

Part Number: MSP432E401Y

I am testing an adcbufmultisequencer example project

Changed recurrenceMode from ADCBuf_RECURRENCE_MODE_CONTINUOUS to ADCBuf_RECURRENCE_MODE_ONE_SHOT.

There is a problem that the adcBufCallback () function does not occur after starting the program for a while.
Once the problem occurred, running the ADCBuf_convert () function again did not cause the adcBufCallback () function.

Is there something wrong with the code I wrote below?
What is the cause?
Is the speed of 1MSMSP too fast to use with TI-RTOS?
=======================================================================

    /* Set up an ADCBuf peripheral in ADCBuf_RECURRENCE_MODE_CONTINUOUS */
    ADCBuf_Params_init(&adcBufParams);
    adcBufParams.callbackFxn = adcBufCallback;
    adcBufParams.recurrenceMode = ADCBuf_RECURRENCE_MODE_ONE_SHOT;          // <- one shot mode
    adcBufParams.returnMode = ADCBuf_RETURN_MODE_CALLBACK;
    adcBufParams.samplingFrequency = 1000000;
    adcBuf = ADCBuf_open(CONFIG_ADCBUF0, &adcBufParams);

    /* Configure the conversion struct for Sample Sequencer 0 */
    continuousConversion[0].arg = NULL;
    continuousConversion[0].adcChannel = CONFIG_ADCBUF0CHANNEL_0;
    continuousConversion[0].sampleBuffer = sequencer0BufferOne;
    continuousConversion[0].sampleBufferTwo = sequencer0BufferTwo;
    continuousConversion[0].samplesRequestedCount = ADCBUFFERSIZE;                   // <- Buffer size is 100

    /* Configure the conversion struct for Sample Sequencer 1*/
    continuousConversion[1].arg = NULL;
    continuousConversion[1].adcChannel = CONFIG_ADCBUF0CHANNEL_1;
    continuousConversion[1].sampleBuffer = sequencer1BufferOne;
    continuousConversion[1].sampleBufferTwo = sequencer1BufferTwo;
    continuousConversion[1].samplesRequestedCount = ADCBUFFERSIZE;


    if (!adcBuf){
        /* AdcBuf did not open correctly. */
        while(1);
    }

    while(1) 
    {
        cb_cnt = 2;
        if(ADCBuf_convert(adcBuf, &continuousConversion[0], 1) != ADCBuf_STATUS_SUCCESS)     // <- call function every loop
        {
           while (1) usleep(1);
        }
        if(ADCBuf_convert(adcBuf, &continuousConversion[1], 1) != ADCBuf_STATUS_SUCCESS)
        {
           while (1) usleep(1);
        }

        if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
            return 0;

        ts.tv_sec += 1;

        if(sem_timedwait(&adcbufSem, &ts) < 0)              // <- use sem_timedwait() for debug instead sem_wait()
        {
            adc_fail_count++;
            continue;
        }

        adc_done_count++;

    }

  • Dear customer,

    Thank you for your inquiry related to the MSP432 product. We recommend that you consult the many resources at dev.ti.com, including SDK user’s guides, libraries, utilities, software examples and SimpleLink Academy training modules.  

    Thank you for your time and consideration,

    Seong

**Attention** This is a public forum