How to set the interrupt priority?

Status
Not open for further replies.

qmriso

Member level 5
Joined
Nov 30, 2006
Messages
80
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,879
hello

I am using two interrupts in my program,one is reception interrupt and one more is timer interrupt.
I am using timer interrupt for generating PWM waveforms.I want to give priority to timer interrupt.so i have to make timer pripority inerrupt bit high.Other then this setting any other setting i have to make or it's not required
 

Using 2 Interrupts

Set your IVT first..that way you could priortize your interrupts..
 

Re: Using 2 Interrupts

What microcontroller are you using?
If the uC has a compare/ PWM generation unit, it can generate the PWM with a duty cycle determined by the value in the compare unit registers. In this case, you don't need interrupts for the PWM generation, you need only to set the compare/PWM value in your program.
But if you generate PWM in software you may need some interrupt. To set a priority, you can globaly disable the interrupts in the service routine that has priority.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…