Other Parts Discussed in Thread: EK-TM4C1294XL
Hello.
I have questions.
Can I change the interrupt priority of GPIO?
If yes, could you tell me how to do it?
Regards,
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.
Hello.
I have questions.
Can I change the interrupt priority of GPIO?
If yes, could you tell me how to do it?
Regards,
Bruno Saraiva said:Actually, from my experience, it is quite "rare" that you'd need to get as deep as to determine interrupt priorities
I've yet to do a system that required interrupts that didn't also require managing the priority. The only reason to use interrupts is if latency matters and if it matters you need to manage the priorities.
Robert
Bruno Saraiva said:I understand your comment about needing to manage interrupts. But it is indeed the case for most of our applications here - that the order in which interrupts are served does not matter, as long as they are not "forgotten". If I have interrupts on GPIO's, completed SPI readings, complete analog reading, and you still have enormous 50ms to deal with those events, it does not matter which one is served first.
Then why use interrupts at all? If latency is not important polling is more efficient.
That's not to say that you cannot use interrupts, just that they don't appear to be required.
Robert
Bruno Saraiva said:it is indeed the case for most of our applications here - that the order in which interrupts are served does not matter
While that's "offered up" - missing is (any) justification for such claim. ("not creative enough (today)" ... is not particularly compelling.)
Do you (really) want to, "Pass such advice onto others" - who may encounter your post - and "adopt" its guidance? I have "no doubts" that you fully believe what you've presented - yet as it "strays far" from the "normal/customary" - does it not warrant (some) justification/creativity? (to properly describe, "IF & WHEN" this "Bruno Method" (No priorities) is safe to be deployed!) That's fair - is it not?
How do you positively "know" - that the "near" or simultaneous arrival of two (perhaps even three) interrupts - will not demand (or at least provide "benefit") when "interrupt priorities are proper" and "in play?"
Is it not true that w/out "interrupt priorities being considered - and applied" - that "all code is enabled to run & execute equally?" Is it not likely that several functions share, "key functional dependencies" - and may "mis-perform" - and/or perform poorly" - when "shared data" is "missed" or "passed out of order?" (note that you yourself described the use of "volatile" - in the attempt to combat such - in another of your posts today.)
Might the fact that ALL modern MCU vendors include the ability to "Prioritize Interrupts" - suggest that such "attention to detail" is more often "needed" than not?
It is perhaps the, "unusual and/or unexpected arrival" of interrupts - which may surely justify, "Use of prioritization." If your code is simple enough to "escape" such prioritization - then any "Use of Interrupts" adds complication - (seemingly w/out benefit) - and may be judged "suspect."
"Can I change the interrupt priority of GPIO?"
yes, as the core supports it.
"If yes, could you tell me how to do it?"
it will depend on your tool chain. I work under CMSIS and the following does it: "NVIC_SetPriority(Irq, priority)".
it works across all CM0/1/2/3/4/7 familities, TI's or otherwise.
Greetings Rohail,
May I note your "most excellent example" - which clearly identifies such "justification" for "Interrupt Priorities." And for your "first ever posting" ... BRAVO!
Note too - that in "ultra-demanding" situations - one may, "Extend & Enhance" Interrupt Priority via, "Promoting a specific interrupt to, "PRE-EMPTIVE Status." Such will enable the temporary "Halt of an interrupt in progress" - and instead insure the "most rapid" execution of this "more favored" (i.e. pre-empting) interrupt.
Such proves a (very) nice (and powerful) addition to one's, "MCU Bag of Tricks..."