cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446 Interrupt Query

shivani gandhi
Associate
Posted on July 10, 2018 at 08:03

I am using STM32F446 Microcontroller in my project.

But i have some points to know about  Interrupt.

1. if i use multiple interupts  and  i am  not assign priority of interrupt than how interrupts execute?

2. If I assign same priority of multiple interrupt than what will happen?

3. If high priority interrupt execution is on going then a low priority interrupt comes than what will happen?

4. If low priority interrupt execution is on going then a high priority interrupt comes than what will happen?

3 REPLIES 3
AvaTar
Lead
T J
Lead
Posted on July 10, 2018 at 11:45

I would suggest that you should be in and out of your interrupt within 20uS.

Since interrupts usually work on specific aspects of Firmware,

they usually don't interfere with each other and then priorities don't really matter too much.

If your work is intensive then priorities are more of an issue.

I create a Global Table of 64 Rows, for the interrupt to dump its contents in one row and set a Global flag.

I check for that flag and others in a worker / printing / debug  thread.

Posted on July 10, 2018 at 10:48

Maybe PM0214 is slightly better reading in this regard (you need also the ARMv7M ARM) - or, the best, are Clive's favourite Joseph Yiu books ('The definitive guide to ARM Cortex-M3/4').

In short, interrupt A can be interrupted ('preempted' in ARM's parlance) by other interrupt B  only if B's so called group priority is strictly higher than A's group priority. Priorities to interrupts are are asigned in NVIC_IPRx registers, and how many bits from this priority is used to determine group priority, is given by (SCB_) AIRCR.PRIGROUP (see PM0214).

1. if i use multiple interupts  and  i am  not assign priority of interrupt than how interrupts execute?

If you don't assign priority, they are by default the same, then if interrupt B gets triggered while interrupt A is ececuting, interrupt A will be executed to end, then interrupt B will be executed (the exit/entry between them will be shortened by tail-chaining).

2. If I assign same priority of multiple interrupt than what will happen?

Sames as in 1.

3. If high priority interrupt execution is on going then a low priority interrupt comes than what will happen?

Same as in 1.

4. If low priority interrupt execution is on going then a high priority interrupt comes than what will happen?

A will be interrupted by B; when B is executed to end, A will continue.

JW