Trigger interrupt via software

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trigger interrupt via software

2,159 Views
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 Reply

1,376 Views
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