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:高频 ADCBuf 回调失败

Guru**** 2540720 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1000939/msp432e401y-high-frequency-adcbuf-callback-fail

器件型号:MSP432E401Y

我需要在1MHz 的速度下获得大量 AD 数据。
我将使用 adcBufTemperature 示例进行测试。

在此示例中,我只更改了 samplingFrequency 和 samplesRequestedCount,并在 while 循环中添加了 ADCBuf_convert()。

    /* 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.samplingFrequency = 1000000;

    adcBuf = ADCBuf_open(CONFIG_ADCBUF_0, &adcBufParams);

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

    /* Configure the conversion struct */
    continuousConversion.arg = NULL;
    continuousConversion.adcChannel = CONFIG_ADCBUF_0_CHANNEL_0;
    continuousConversion.sampleBuffer = sampleBufferOne;
    continuousConversion.sampleBufferTwo = sampleBufferOne;
    continuousConversion.samplesRequestedCount = 1000;

    /*
     * Go to sleep in the foreground thread forever. The data will be collected
     * and transfered in the background thread
     */
    while(1) {
        if (ADCBuf_convert(adcBuf, &continuousConversion, 1) !=
            ADCBuf_STATUS_SUCCESS) {
            /* Did not start conversion process correctly. */
            while(1);
        }
        /* Wait for semaphore and print average temperature */
        sem_wait(&adcbufSem);
       /* Print a message with average temperature */
        Display_printf(displayHandle, 0, 0, "The average temperature is %.3fC",
         avgTemperature);
    }

但是,在几个循环之后,adcBufCallback()不再出现。
采样率是否存在任何限制?

此外、溢出标志在 ADC_OSTAT 中提出。 我可以忽略它吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您可以使用 DMA 进行数据移动。 更多信息、您可以参阅此演示代码

    ADC0_singleended_multimer_timertrigger_dmareq 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢你的答复。
    但是、"adcBufTemperature"示例已使用 DMA。

    ADC0_singleended_multimer_timertrigger_dmareq:无 RTOS
    adcBufTemperature:TI-RTOS

    TI-RTOS 和非 RTOS 之间是否有任何差异?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    只需添加具有 TI-RTOS 版本的 TI-RTOS、建议先使用非 RTOS 版本进行测试