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.

MSP430I2021: Set interrupt priority between timer and GPIO interrupt

Part Number: MSP430I2021

Hello sir/mem,

i am working on msp430i2021. 

i am used timer interrupt and gpio interrupt.

i read user guide.in vector table gpio interrupt is highest priority. but i require timer interrupt set highest piority and second highest set is gpio intterupt.

so please provide to help hoe to manage this.

  • If your system can tolerate losing a few clock cycles (and also depending on the frequency of these interrupts), you could probably try the following:
    * The interrupt function of the GPIO is modified to do only one thing, which is set a flag (here is were you lose a few clock cycles).
    * The Timer interrupt function checks the flag before it returns. If the flag is set, it clears the flag and calls the actual function you intended the GPIO to do.

    This would make it appear as if the Timer has higher priority.

  • Hello,

    There is no way to alter interrupt priority because it is built-in to the MCU silicon architecture.

    Here is another e2e thread that discusses interrupt priority:

    https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/52759

    Mike offers a good suggestion of making the GPIO interrupt as short as possible so that the timer interrupt is serviced faster. You can also increase MCLK frequency if it is still below its maximum to have all interrupts serviced faster.

    Regards,

    Ryan

**Attention** This is a public forum