The use of the Hardware Interrupt block in Target Support Package TC2
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Kaustubha Govind
2011년 11월 23일
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
Kaustubha Govind
2011년 12월 21일
w: Could you report this to MathWorks Tech Support with a simple model for reproduction? Perhaps it is a bug?
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!