Interrupt priority

12 Jul 2012

Hello All:

I am relatively new to the MBED world (using models: LPC1768 and LPC11U24) and need some help setting the priorities of interrupts. I want to set a logic level interrupt using InterruptIn (with highest priority) and have a Timeout interrupt to have less priority(). NVIC_SetPriority(TIMER3_IRQn, 255) has popped up many times while searching for the solution. It works great but what if I wanted to increase the priority of InterruptIn? How can I change the priority of InterruptIn? And how can I see what the interrupt priority is when created?

Ryan

12 Jul 2012

Starting with disclaimer, this is just from what I just looked up in LPC1768 user manual and a little bit of knowledge of the interrupts, but I haven't actually done anything myself with interrupt priority.

Quote:

It works great but what if I wanted to increase the priority of InterruptIn?

Then you are out of luck, by default all interrupts are at maximum priority. I expect that there place in the interrupt vector controller then determines which one is called first (Timer3 for example is one of the first, so when priority is equal to that of your input pin it will be dealt with first, but they both will let the other finish his interrupt first when that one was called first. So when interrupt in is called 50ns before timer3, it will do interruptin first).

Quote:

How can I change the priority of InterruptIn?

User manual says:

Quote:

GPIO0 and GPIO2 interrupts share the same position in the NVIC with External Interrupt 3.

So NVIC_SetPriority(EINT3_IRQn, #) should work for that.

Quote:

And how can I see what the interrupt priority is when created?

See first one, by default all interrupts have maximum priority.

13 Jul 2012

Thank you Erik. That should do wonderful. Your diligence is much appreciated!

Ryan