Interrupt priority in MPC 5602B

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Interrupt priority in MPC 5602B

2,012 次查看
bengtandersson
Contributor III

I have a problem where my timer interrupt (irq 30) at priority 2 is not interrupted by an uart interrupt (irq 79) with priority 6. Are there any special measures to be taken if this priority should work as expected. I'm calling another function from the timer ISR, is that OK?

标签 (1)
4 回复数

1,812 次查看
martin_kovar
NXP Employee
NXP Employee

Hi Bengt,

if you use CodeWarrior, there is macro in IntcInterrupts.c file called INTC_NESTED_INTERRUPT. If you want to preempt one interrupt by some other with higher priority, set this macro to 1.

pastedImage_1.png

If you look at lines below in this file, you will find conditional compilation code. If INTC_NESTED_INTEERUPT is 1, part with prolog and epilog is used.

pastedImage_2.png

About calling function in ISR, it depends on the implementation, but in general there is not any system problem.

If you have any other question, please feel free to write me back.

Regards,

Martin

0 项奖励
回复

1,812 次查看
bengtandersson
Contributor III

Hi Martin!

I have another question. Why are nested interrupts not the default behavior in CW? Is this feature not recommended?

Regards Bengt

0 项奖励
回复

1,812 次查看
martin_kovar
NXP Employee
NXP Employee

Hi Bengt,

I am not able to tell you, why nested interrupts are not default behavior, but there is no problem with this feature. From my point of view, you do not have to worry about it. Of course there should appear a problem if you incorrectly design the algorithm, but it is application dependent. I think you can definitely use nested interrupts, if it bring you some advantages.

If you have any other questions, please feel free to write me back.

Regards,

Martin

0 项奖励
回复

1,812 次查看
bengtandersson
Contributor III

Hi Martin!

Pretty obvious now that I know where to look :smileyhappy:

Tested and works as expected!

Thanks!!

Regards Bengt