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.

TMS320F28P550SJ: ADC overflow

Part Number: TMS320F28P550SJ

Hi,

I made a project based on the "adc_ex2_soc_epwm" example, I increased the pwm frequency to 200KHZ. I noticed that when I remove the part of the code below, which checks for overflow, after some time the ADC stops generating interrupts. Apparently if an overflow occurs and the corresponding flag is not cleared, the ADC interrupts stop happening. How can I configure the ADC so that interruptions never stop happening even if an overflow occurs? Because I don't want to use this slow code that keeps checking for overflow because my interruption rate is very high.

if(true == ADC_getInterruptOverflowStatus(myADC0_BASE, ADC_INT_NUMBER1))
{
ADC_clearInterruptOverflowStatus(myADC0_BASE, ADC_INT_NUMBER1);
ADC_clearInterruptStatus(myADC0_BASE, ADC_INT_NUMBER1);
}

Ari

  • Hello Ari,

    Fullscreen
    1
    ADC_enableContinuousMode(myADC0_BASE, ADC_INT_NUMBER1);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This writes to the INT1CONT bit of the ADCINTSEL1N2 register.

    Best regards,
    Ibukun

  • Thank you Ibukun, now it is working without having to check for overflow.
    Is there any advantage to not using the "continuous mode for ADC interrupt"?

    Ari

  • Ari,

    The primary function of the overflow status flag is to help ensure that no ADC conversions are missed due to processing happening elsewhere, and to give the system a chance to respond properly to a missed conversion. If in your system you don't care if a conversion was missed (e.g. due to a different peripheral interrupt taking up processing time), then you can just ignore the flag. If a missed conversion does have consequences, then you should check the overflow status and handle it.

    Continuous mode simply tells the ADC to keep issuing CPU interrupts regardless of whether an overflow occurs. This may not be desirable in some systems (e.g. safety critical) but is acceptable for others.

    Best regards,
    Ibukun