Trigger interrupt via software

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

Trigger interrupt via software

3,222 次查看
grzegorzkonopko
Contributor III

Hi

I am looking in to documentation and can not find how to: trigger interrupt via software. What I would like to achieve is trigger peripheral interrupt (like UART) in order to start execution interrupt service routine in way as standard hardware interupt triggered it.

Is is possible in kinetis?

Best Regards

/Greg

1 回复

2,439 次查看
isaacavila
NXP Employee
NXP Employee

Hello,

Yes, It is possible to do this on Kinetis, you have to write to NVIC's registers, in KDS IDE you can put a pending interrupt with the instruction NVIC_SetPendingIRQ(IRQn_Type IRQn) where IRQn is your Interrupt vector.

ISPR.jpg

This is specify in the ARM documentation (www.arm.com), you can check the Technical Reference Manual for Cortex-M4 or Cortex-M0+, I don’t know what device you are using.

Note that as you are using a “NVIC set pending” there is not flag and you just have to clear the pending in the NVIC registers.

Hope this helps!

Regards,
Isaac