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.

Counters/Timers/ISR question



For lack of a better title; i have a question concerning using timers with ISRs. For example in my program I'm using the WDT interrupt vector to modify a register for use with my LCD code.

 

Are you only allowed to use one ISR per timer? For example, if I am using this WDT isr for one of my LCD subroutines...can I not "point" the WDT interrupt to a different ISR for use in a different part of the program?

 

In my case I want to use it for the LCD subroutine and for a button debouncing interrupt subroutine. Is this possible or is another timer source(timer A or timer B) necessary?

 

Thanks,

 

ps - I tried having 2 separate ISRs for the WDT and the compiler didn't like that

  • More simply; can you point an interrupt to multiple ISRs?

  • No. But you can call ifferent normal functions from inside your ISR, depending on the current usage.

    Doing so in C, however, results in an increased stack usage and decreased execution speed.

    If your ISR is written in assembly language, it can just jump to different ISRs which have no vector assigned to them directly (omit the #pragma). You only have to ensure that this 'stub' isr does not touch any processor register, only global variables or hardware registers.
    It is relatively easy on mspgcc with inline assembly in an ISR with 'naked' attribute (so no entry/exit code is generated, since the ISRs you jump to will have their own)

**Attention** This is a public forum