The use of the Hardware Interrupt block in Target Support Package TC2
2 views (last 30 days)
Show older comments
In the hardware Interrupt block, there is a parameter named preemption flag. In the help document,i got that "Preemption overrides prioritization, such that a preemptable task of higher priority can be preempted by a non-preemptable task of lower priority."
I set my interrupt1' priority is 30 and the preemptition flag is 0(non-preemptable);the interrupt2's priority is 25 and the preemptition flag is 1(preemptable).
So i think when the interrupt1 happened and the program runs in the interrupt1 service routine,if interrupt2 is triggered, my program will run to the interrupt2 service routine immediately.And when the interrupt2 service routine ran over,the program returned to interrupt1 service routine.Is this right? But i didn’t get this result in my oscillograph after loading the generted code to my DSP board. Could somebody explain the use of the preemptition flag?
What is the relationship between the sample time and the base rate?
Best regards.
0 Comments
Answers (1)
Kaustubha Govind
on 23 Nov 2011
I think the expected behavior would be as follows:
when the interrupt1 happened and the program runs in the interrupt1 service routine,if interrupt2 is triggered -> interrupt1 will continue to run because it is non-preemptable.
You probably want to switch your pre-emption flags around if you need interrupt2 to pre-empt interrupt1.
2 Comments
Kaustubha Govind
on 21 Dec 2011
w: Could you report this to MathWorks Tech Support with a simple model for reproduction? Perhaps it is a bug?
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!