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.

OMAP-L138 timer example

All:

The timer example in Starterware has an interrupt service routine that has an interrupt service routine (TimerIsr) that first disables the timer interrupt ( TimerIntDisable() ) and at the end of the isr re-enables the timer interrupt ( TimerIntEnable() ).

Is it really necessary to disable and re-enable during the isr?

  • Dear Todd,
    Yes, I hope so, we are make sure that no interrupt should happen while we are processing the ISR.

    You can see that Interrupt disabling in ISR in all the starterware examples.

  • Hi Todd,

    Todd said:
    The timer example in Starterware has an interrupt service routine that has an interrupt service routine (TimerIsr) that first disables the timer interrupt ( TimerIntDisable() ) and at the end of the isr re-enables the timer interrupt ( TimerIntEnable() ).

    Is it really necessary to disable and re-enable during the isr?


    Once the timer interrupt is happenned, the Timer ISR runs. Consider if the time taken to execute the code in the timer ISR is greater than the time interval between the consequent timer interrupts, then the ISR initiated may not get completed for the first interrupt. Logically the code should be written in susch a way that the ISR should be serviced before it receives the next interrupt. But for the safer side, it is disabled and re-enabled here.
    It is actually not necessary to disable and re-enable.
  • Thanks, guys!

    For verification of interrupt time, I used a GPIO output, which I set at the beginning of the interrupt and reset at the end. It's a little bit of overhead, but it can be #if'd out when not in use. I know on C2000, if an interrupt is in progress, all other interrupts are disabled unless specifically "re-enabled" inside of an ISR. Is that not the case on C6000? (C2000 folks discourage interrupt nesting - if that is needed, they say you should use an RTOS or DSP-BIOS.)

  • Todd,

    Actually, in C6000, interrupt nesting is supported. But I don't think any example exist so far to demonstrate the interrupt nesting.
  • But, if you are servicing a C6000 interrupt, are other interrupts disabled unless enabled inside of the interrupt service routine?

    That is why I was wondering why it was really necessary to disable and enable timer interrupts within the timer interrupt service routine.

  • Todd,

    Todd said:
    But, if you are servicing a C6000 interrupt, are other interrupts disabled unless enabled inside of the interrupt service routine?


    I have personally tested this example by commenting out the two lines, "TimerIntDisable" and "TimerIntEnable"

    It would still work as expected. It is not nescessary to disable and enable the interrupts inside the timer isr.