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.

TMS320F28027: IFR Interrupt flag stop to be set

Part Number: TMS320F28027

I draft an example code as below file, use PWM timer to trigger ADC sample, and implement both PWM and ADC interrupt.  

The key point is PWM interrupt code will occupy long time to block the ADC interrupt, until ADC interrupt overlay flag is set, then clear the ADC overlay flag and release PWM interrupt to resume ADC interrupt.

 

Example_2802xAdcTempSensor.txt
Fullscreen
1
2
3
4
5
6
//###########################################################################
//
// FILE: Example_2802xAdcTempSensor.c
//
// TITLE: f2802x ADC Temperature Sensor Example Program.
//
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

However after run a while on TI LaunchPad, both the PWM and ADC stop to jump into interrupt functions.  

I double confirm the register that ADC/PWM interrupt flag is set and enable, the PIE flag is also set and enable, the IER is also enable, however the IFR is not be set.

I doubt if it is something wrong in the C2000 interrupt hardware, may I appreciate your help check and advice?  

 

  • Terry,

    Thank you for capturing the register values.  I see that ADCINTOVF flag 0x4 is still set, which means that additional ADCINT3 interrupts were not serviced in time.

    The ADC may fail to trigger system interrupts while ADCINTOVF flags are set.  All overflow flags should be cleared using the ADCINTOVFCLR register.

    Another option is to configure the ADCINT to run in continuous mode so that interrupts continue to trigger even if they are not serviced in time.

    It should be possible to do both:  Configure the system to service and clear ADCINT flags as the primary approach, but enable continuous mode so that interrupts are not missed in the unlikely event that there are overflows.

    -Tommy

  • Terry,
    I'm going to close this thread, please comeback with any questions you may still have.

    Regards,
    Cody