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.

What is the purpose of Timer32 INTC (composite/combined interrupt)

I understand how the Timer32 interrupts on the MSP432P401R work in detail.

What exactly is the purpose of the T32_INTC interrupt?  What would one EVER use it for?

The only thing I can think of is to save code space if the handlers for Timer32_1 and Timer32_2 are substancially the same.  But why would one ever do that?  One would just do everything off a single interrupt.  There is no advantage to having two interrupts do the same thing.

If the handlers do substansially different things then one would never combine the interrupt via INTC.

Could someone ask the designer of the Timer32 subsystem about why they added INTC?  I'm wondering what they were thinking in case I'm just not seeing the reasoning.

Overall though an outstanding implementation.  Really nice part and I've been around and was trained as a computer architect.

thanks

  • Hello Eric!
    This is a good question.
    I agree that for a vast majority of the use cases, using the Timer counters and their handlers independently is the most common way to use it.
    However, have you considered a case, where you would 'not' want to use it?
    for example, consider a point of time in the application, where the app does not care which counter it came, it knows to ignore it, or exit quickly or..?
    In such a case, instead of replicating the code in each handler, I could use the combined interrupt, which is basically an OR of the 2 separate ones and expect the same functionality no matter which counter fires.

    I could also see assigning a higher priority and using the INTC to do some further priority sorting in software.

    These are just a few ideas...

    Regards,
    Priya
  • >> Hello Eric!
    >> This is a good question.
    >> I agree that for a vast majority of the use cases, using the Timer counters and their handlers independently is the most common way to use it.
    >> However, have you considered a case, where you would 'not' want to use it?
    >> for example, consider a point of time in the application, where the app does not care which counter it came, it knows to ignore it, or exit quickly or..?

    the problem is the INTC handler can't IGNORE it, rather regardless the INTC handler has to figure out which interrupt popped so it  can clear it.  That is what makes INTC not useful.


    >> In such a case, instead of replicating the code in each handler, I could use the combined interrupt, which is basically an OR of the 2 separate ones and expect the >> same functionality no matter which counter fires.

    see above.

    The issue with the scenerio you are proposing above is you still have to know which Timer generated the interrupt because you have to clear the interrupt manually.  Which means you have to know which one interrupted.  So you first have to check which timer is generating the interrupt so you can clear the correct interrupt.

    Once you have to look to see which timer is interrupting, you lose any advantage of the combined interrupt.  It is simpler to use the base interrupt because you can immediately clear the interrupt and then call a common routine.

    >> I could also see assigning a higher priority and using the INTC to do some further priority sorting in software.

    Okay.  Can you be more specific about what you are thinking.  I don't see how I can get INTC to do something useful by playing with priorities.  The key issue is one needs to clear the appropriate interrupt.

    Someone clearly thought there was something useful to be gained by adding INTC, I'm trying to understand what that might be.

    So far I don't see how to use INTC for anything useful that wouldn't be simpler using the base interrupts.



    >> These are just a few ideas...

    >> Regards,
    >> Priya

  • Eric,
    Sorry if that was unclear.

    I was trying to envision a scenario where TaskA and TaskB were tied to INT1 and INT2 and TaskC was tied to INTC (which is basically an OR of 1 and 2). And that way instead of adding control code in the ISR, I'm adding it to NVIC setup.

    To enable the TIMINTC interrupt and not TIMINT1 and TIMINT2 interrupts you would need to do the following:
    1) Enable TIMINT1 or TIMINT2 interrupt in the Timer 32 module and start the timers.
    2) Disable TIMINT1 and TIMINT2 interrupts at NVIC level
    3) Enable TIMINTC interrupt at NVIC level. --> so here I could add if (TaskC) == true, then do step # 3

    But you are right in that this is just pushing the logic check elsewhere and is not necessarily more efficient.

    Our Systems engineer tells me that this peripheral (and the combined interrupt feature) is a standard ARM Timer.

    -Priya
  • Priya Thanigai said:
    Eric,
    Sorry if that was unclear.

    I was trying to envision a scenario where TaskA and TaskB were tied to INT1 and INT2 and TaskC was tied to INTC (which is basically an OR of 1 and 2). And that way instead of adding control code in the ISR, I'm adding it to NVIC setup.

    To enable the TIMINTC interrupt and not TIMINT1 and TIMINT2 interrupts you would need to do the following:
    1) Enable TIMINT1 or TIMINT2 interrupt in the Timer 32 module and start the timers.
    2) Disable TIMINT1 and TIMINT2 interrupts at NVIC level
    3) Enable TIMINTC interrupt at NVIC level. --> so here I could add if (TaskC) == true, then do step # 3

    But you are right in that this is just pushing the logic check elsewhere and is not necessarily more efficient.

    Our Systems engineer tells me that this peripheral (and the combined interrupt feature) is a standard ARM Timer.

    -Priya

    no worries.  thanks for taking the time to get back to me.

    that was my point.  I was looking to see if there was something that I was missing because someone took the time to expend the gates to implement this.

    I've tried finding ARM documentation on the Timer32 stuff to see if they are the ones who spec'd the INTC interrupt but no luck.

    thanks again,

    eric

**Attention** This is a public forum