cancel
Showing results for 
Search instead for 
Did you mean: 

What would be the best practice to disable an interrupt?

Clonimus74
Senior II
Posted on November 01, 2017 at 11:42

Hi,

In your opinion, what would be the proper way to disable an interrupt, disabling only the peripheral enable bit or also the NVIC bit?

Is there a risk to disable only the peripheral bit and leaving the NVIC IRQ enabled? in the case of EXTI5-9, for example, that is a must, so I wonder, if for efficiency sake it is good practice to leave the NVIC always enabled?

#interrupts #nvic #irq
7 REPLIES 7
Uwe Bonnes
Principal III
Posted on November 01, 2017 at 12:15

Both disabling the device or the NVIC take serveral cycles to take effect. This must be considered.

Posted on November 01, 2017 at 13:18

At the source...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
howard n2wx
Senior
Posted on November 01, 2017 at 13:56

Both answers above are clearly correct. If you want to dig deeper then google is your friend with 6 useful links on the first page:

https://www.google.com/search?q=nvic+disable+interrupt+delay

Posted on November 01, 2017 at 13:49

At the source, meaning, at the peripheral alone is sufficient, as I thought. Is that what you mean?

Posted on November 01, 2017 at 13:58

Yes, the peripheral typically has the logic to latch/clear things and gate things downstream, so usually the best place to enable/disable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on November 01, 2017 at 14:03

Google is a great friend but that is not what I was asking. I don't care about those tiny delays, what I was pondering about was opposite to your google search, I was trying to get your opinion if using just the peripheral interrupt disable is safe enough to disable the interrupt without changing the NVIC settings, is it a good practice....

Posted on November 01, 2017 at 14:30

is it a good practice....

It's not. The infocenter.arm.com link outlines the reason.